📄 deletealldialog.java~21~
字号:
package changeExts;import java.awt.*;import javax.swing.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class DeleteAllDialog extends JDialog { ChangeExts changeExts; String strDir,strExts; JPanel panel1 = new JPanel(); JLabel jLabel1 = new JLabel(); JLabel jLabel2 = new JLabel(); FlowLayout flowLayout1 = new FlowLayout(); JButton jButton1 = new JButton(); JButton jButton2 = new JButton(); public DeleteAllDialog() { super(); } public DeleteAllDialog(ChangeExts chExts) { //super(frame, title, modal); try { changeExts=chExts; jbInit(); pack(); } catch(Exception ex) { ex.printStackTrace(); } } //public DeleteAllDialog() { //this(null, "", false); //} private void jbInit() throws Exception { //strDir=changeExts.getFDir(); //strExts=changeExts.getFExts(); //String str1,str2; //if(strDir!=null&&strExts!=null){ // str1="您确实要删除\" "+strDir+"\\\" 下的所有 \""+strExts; // str2="\" 类型文件吗?"; //} //else{ // str1="请先选择你要删除的文件,再执行这一步操作!"; // str2=""; //} panel1.setLayout(flowLayout1); jLabel1.setText("111"); jLabel1.setVerticalAlignment(SwingConstants.TOP); jLabel1.setVerticalTextPosition(SwingConstants.CENTER); jLabel2.setText("222"); jLabel2.setVerticalAlignment(SwingConstants.TOP); jButton1.setActionCommand("ok"); jButton1.setText("ok"); jButton1.setVerticalAlignment(SwingConstants.CENTER); jButton1.addActionListener(new DeleteAllDialog_jButton1_actionAdapter(this)); jButton2.setText("cancel"); jButton2.addActionListener(new DeleteAllDialog_jButton2_actionAdapter(this)); this.setTitle("Delete all same type files"); panel1.add(jLabel1, null); panel1.add(jLabel2, null); panel1.add(jButton1, null); panel1.add(jButton2, null); getContentPane().add(panel1); } void jButton2_actionPerformed(ActionEvent e) { this.dispose(); } void jButton1_actionPerformed(ActionEvent e) { if(strDir!=null&&strExts!=null){ Strategy strategy3=new CStrategy3(changeExts); strategy3.read(strDir,strExts,null); strategy3.save(); this.dispose(); }else{ this.dispose(); } }}class DeleteAllDialog_jButton2_actionAdapter implements java.awt.event.ActionListener { DeleteAllDialog adaptee; DeleteAllDialog_jButton2_actionAdapter(DeleteAllDialog adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton2_actionPerformed(e); }}class DeleteAllDialog_jButton1_actionAdapter implements java.awt.event.ActionListener { DeleteAllDialog adaptee; DeleteAllDialog_jButton1_actionAdapter(DeleteAllDialog adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton1_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -