⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dreplace.java

📁 NETBEANS6.5的项目包。能够对文件进行批量的重命名操作
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package xechanger;import java.awt.FlowLayout;import java.awt.GridLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JCheckBox;import javax.swing.JDialog;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPanel;import javax.swing.JTextField;/** * * @author Chohei */public class DReplace extends JDialog {    private JTextField bbf;    private JTextField aaf;    private JLabel lb1;    private JLabel lb2;    private JCheckBox repa;    private JPanel inpn;    private JPanel lin1;    private JPanel lin2;    private JPanel lin3;    private JPanel lin4;    private JButton jbOK;    private JButton jbCL;    private boolean sts;    public DReplace(JFrame aFrame) {        super(aFrame, true);        sts = false;        bbf = new JTextField(20);        aaf = new JTextField(20);        lb1 = new JLabel("查  找:");        lb2 = new JLabel("替换为:");        jbOK = new JButton("替换");        jbCL = new JButton("取消");        repa = new JCheckBox("每个文件只替换一次");        setTitle("替换");        FlowLayout flv = new FlowLayout(FlowLayout.CENTER, 10, 5);        inpn = new JPanel();        lin1 = new JPanel(flv);        lin2 = new JPanel(flv);        lin4 = new JPanel(flv);        lin3 = new JPanel(flv);        inpn.setLayout(new GridLayout(4, 1, 0, 0));        lin1.add(lb1);        lin1.add(bbf);        lin2.add(lb2);        lin2.add(aaf);        lin3.add(repa);        lin4.add(jbOK);        lin4.add(jbCL);        inpn.add(lin1);        inpn.add(lin2);        inpn.add(lin3);        inpn.add(lin4);        setContentPane(inpn);        this.setResizable(false);        jbCL.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                clClick(e);            }        });        jbOK.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                okClick(e);            }        });    }    private void clClick(ActionEvent e) {        sts = false;        this.setVisible(false);    }    private void okClick(ActionEvent e) {        sts = true;        this.setVisible(false);    }    public String getBef() {        return bbf.getText();    }    public String getAft() {        return aaf.getText();    }    public boolean isOnce() {        return repa.isSelected();    }    public boolean isOK() {        return sts;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -