dwindow.java
来自「200多个自己编的java程序,大家可以学一下.」· Java 代码 · 共 72 行
JAVA
72 行
/* * 带对话框的Frame.java * * Created on 2004年9月25日, 上午9:10 *//** * * @author litertiger */public class Dwindow extends javax.swing.JFrame { /** Creates new form 带对话框的Frame */ public Dwindow() { 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 button1 = new java.awt.Button(); button2 = new java.awt.Button(); getContentPane().setLayout(new java.awt.FlowLayout()); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); } }); button1.setLabel("\u6253\u5f00"); button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { button1ActionPerformed(evt); } }); getContentPane().add(button1); button2.setLabel("\u5173\u95ed"); getContentPane().add(button2); pack(); }//GEN-END:initComponents private void button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button1ActionPerformed // TODO 将在此处增加您的处理代码: }//GEN-LAST:event_button1ActionPerformed /** 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 Dwindow().show(); } // 变量声明 - 不进行修改//GEN-BEGIN:variables private java.awt.Button button1; private java.awt.Button button2; // 变量声明结束//GEN-END:variables }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?