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

📄 cz.java

📁 记事本是用netbeans写的
💻 JAVA
字号:
/* * cz.java * * Created on 2009年4月7日, 上午10:21 */package notepad;import javax.swing.*;/** * * @author  Administrator */public class cz extends javax.swing.JFrame {    int a=0;//    private boolean check;//    JRadioButton[] teams = new JRadioButton[2];    /** Creates new form cz */    public cz() {        initComponents();    }    /** This method is called from within the constructor to     * initialize the form.     * WARNING: Do NOT modify this code. The content of this method is     * always regenerated by the Form Editor.     */    @SuppressWarnings("unchecked")    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents    private void initComponents() {        buttonGroup1 = new javax.swing.ButtonGroup();        jLabel1 = new javax.swing.JLabel();        jLabel2 = new javax.swing.JLabel();        jTextField1 = new javax.swing.JTextField();        jTextField2 = new javax.swing.JTextField();        jButton1 = new javax.swing.JButton();        jButton2 = new javax.swing.JButton();        jCheckBox1 = new javax.swing.JCheckBox();        jRadioButton1 = new javax.swing.JRadioButton();        jRadioButton2 = new javax.swing.JRadioButton();        jButton3 = new javax.swing.JButton();        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);        jLabel1.setText("查找内容:");        jLabel2.setText("替换为:");        jTextField1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jTextField1ActionPerformed(evt);            }        });        jButton1.setText("查找");        jButton1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton1ActionPerformed(evt);            }        });        jButton2.setText("替换");        jButton2.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton2ActionPerformed(evt);            }        });        jCheckBox1.setText("区分大小写");        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jCheckBox1ActionPerformed(evt);            }        });        buttonGroup1.add(jRadioButton1);        jRadioButton1.setText("向上查找");        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jRadioButton1ActionPerformed(evt);            }        });        buttonGroup1.add(jRadioButton2);        jRadioButton2.setSelected(true);        jRadioButton2.setText("向下查找");        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jRadioButton2ActionPerformed(evt);            }        });        jButton3.setText("取消");        jButton3.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton3ActionPerformed(evt);            }        });        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());        getContentPane().setLayout(layout);        layout.setHorizontalGroup(            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()                        .addContainerGap()                        .addComponent(jCheckBox1)                        .addGap(30, 30, 30)                        .addComponent(jRadioButton1)                        .addGap(31, 31, 31)                        .addComponent(jRadioButton2)                        .addGap(18, 18, 18)                        .addComponent(jButton3))                    .addGroup(layout.createSequentialGroup()                        .addGap(18, 18, 18)                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)                            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                            .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)                            .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE))                        .addGap(29, 29, 29)                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                            .addComponent(jButton2)                            .addComponent(jButton1))))                .addGap(45, 45, 45))        );        layout.setVerticalGroup(            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(layout.createSequentialGroup()                .addGap(20, 20, 20)                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel1)                    .addComponent(jButton1)                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addGap(19, 19, 19)                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                    .addComponent(jButton2)                    .addComponent(jLabel2))                .addGap(18, 18, 18)                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jButton3)                    .addComponent(jRadioButton2)                    .addComponent(jRadioButton1)                    .addComponent(jCheckBox1))                .addGap(11, 11, 11))        );        pack();    }// </editor-fold>//GEN-END:initComponentsprivate void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed// TODO add your handling code here:}//GEN-LAST:event_jTextField1ActionPerformedprivate void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed// TODO add your handling code here:    String Searchtx=jTextField1.getText();    if(Searchtx.equals("")){        JOptionPane.showMessageDialog(this, "请输入查找内容!");        return;    }    else{        jsb b=new jsb(this,true,Searchtx);     //   jb.setVisible(true);        this.setVisible(false);        this.setVisible(true);    }      }//GEN-LAST:event_jButton1ActionPerformedprivate void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed// TODO add your handling code here:}//GEN-LAST:event_jCheckBox1ActionPerformedprivate void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed// TODO add your handling code here:    }//GEN-LAST:event_jRadioButton1ActionPerformedprivate void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed// TODO add your handling code here:}//GEN-LAST:event_jRadioButton2ActionPerformedprivate void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed //TODO add your handling code here:    String Searchtx1=jTextField2.getText();    if(Searchtx1.equals("")){        JOptionPane.showMessageDialog(this, "请输入替换的内容!");        return;    }    else{        jsb t=new jsb(this,true,Searchtx1);        this.setVisible(true);        this.setVisible(false);    }}//GEN-LAST:event_jButton2ActionPerformedprivate void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed// TODO add your handling code here:    this.setVisible(false);}//GEN-LAST:event_jButton3ActionPerformed    /**    * @param args the command line arguments    */    public static void main(String args[]) {        java.awt.EventQueue.invokeLater(new Runnable() {            public void run() {                new cz().setVisible(true);            }        });    }    // Variables declaration - do not modify//GEN-BEGIN:variables    private javax.swing.ButtonGroup buttonGroup1;    private javax.swing.JButton jButton1;    private javax.swing.JButton jButton2;    private javax.swing.JButton jButton3;    private javax.swing.JCheckBox jCheckBox1;    private javax.swing.JLabel jLabel1;    private javax.swing.JLabel jLabel2;    private javax.swing.JRadioButton jRadioButton1;    private javax.swing.JRadioButton jRadioButton2;    private javax.swing.JTextField jTextField1;    private javax.swing.JTextField jTextField2;    // End of variables declaration//GEN-END:variables}

⌨️ 快捷键说明

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