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

📄 jframe.java

📁 200多个自己编的java程序,大家可以学一下.
💻 JAVA
字号:
/* * JFrame.java * * Created on 2004年9月27日, 下午9:48 *//** * * @author  litertiger */public class JFrame extends javax.swing.JFrame {        /** Creates new form JFrame */    public JFrame() {        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.     */    private void initComponents() {//GEN-BEGIN:initComponents        b1 = new javax.swing.JButton();        t1 = new javax.swing.JTextArea();        getContentPane().setLayout(new java.awt.FlowLayout());        addWindowListener(new java.awt.event.WindowAdapter() {            public void windowClosing(java.awt.event.WindowEvent evt) {                exitForm(evt);            }        });        b1.setText("ok");        getContentPane().add(b1);        t1.setBackground(new java.awt.Color(51, 255, 255));        t1.setColumns(40);        t1.setLineWrap(true);        t1.setRows(10);        t1.addKeyListener(new java.awt.event.KeyAdapter() {            public void keyReleased(java.awt.event.KeyEvent evt) {                t1KeyReleased(evt);            }        });        getContentPane().add(t1);        pack();    }//GEN-END:initComponents    private void t1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_t1KeyReleasedt1.setText("the key released");        // TODO 将在此处增加您的处理代码:    }//GEN-LAST:event_t1KeyReleased        /** Exit the Application */    private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm        System.exit(0);    }//GEN-LAST:event_exitForm        /**     * @param args the command line arguments     */    public static void main(String args[]) {        new JFrame().show();    }        // 变量声明 - 不进行修改//GEN-BEGIN:variables    private javax.swing.JButton b1;    private javax.swing.JTextArea t1;    // 变量声明结束//GEN-END:variables    }

⌨️ 快捷键说明

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