資源描述:
《file copy ,web項(xiàng)目復(fù)制》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、packageadfdsa;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.io.File;importjavax.swing.JButton;importjavax.swing.JFileChooser;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JOptionPane;importjavax.swing.JTextField;importjavax.swing.
2、WindowConstants;publicclassCreateEclipseProjectextendsJFrame{privatestaticfinallongserialVersionUID=1L;privateJLabeljLabel1;privateJLabeljLabel2;privateJTextFieldjTextField1;privateJTextFieldjTextField2;privateJButtonjButtonSelect;privateJButtonjButtonOk;privateJButtonjButtonCancel;pub
3、licCreateEclipseProject(finalStringcurrentProject){this.setLayout(null);jLabel1=newJLabel("項(xiàng)目名稱");jLabel1.setFont(newjava.awt.Font("宋體",1,14));jLabel1.setBounds(30,40,80,30);this.add(jLabel1);jTextField1=newJTextField();jTextField1.setBounds(110,40,260,30);this.add(jTextField1);jLabel2
4、=newJLabel("生成路徑");jLabel2.setFont(newjava.awt.Font("宋體",1,14));jLabel2.setBounds(30,100,80,30);this.add(jLabel2);jTextField2=newJTextField();jTextField2.setEditable(false);jTextField2.setBounds(110,100,260,30);this.add(jTextField2);jButtonSelect=newJButton("選擇");jButtonSelect.setFont(
5、newjava.awt.Font("宋體",1,14));jButtonSelect.setBounds(380,100,80,30);this.add(jButtonSelect);jButtonSelect.addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){//TODOAuto-generatedmethodstubgetCreateEclipseProjectPath();}});jButtonOk=newJButton("確定");jButtonOk.s
6、etFont(newjava.awt.Font("宋體",1,14));jButtonOk.setBounds(250,200,80,30);this.add(jButtonOk);jButtonOk.addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){//TODOAuto-generatedmethodstubbooleanisSuccessCreate=createEclipseProject(currentProject,jTextField1.getTex
7、t(),jTextField2.getText());if(isSuccessCreate){JOptionPane.showMessageDialog(null,"項(xiàng)目生成成功","提示",JOptionPane.INFORMATION_MESSAGE);}else{JOptionPane.showMessageDialog(null,"項(xiàng)目生成失敗","提示",JOptionPane.INFORMATION_MESSAGE);}setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);}});jBu