返回列表 發帖
  1. import javax.swing.JFrame;
  2. import javax.swing.JButton;
  3. public class Ch00 {

  4.         public static void main(String[] args) {
  5.                
  6.                
  7.                 JButton btn1=new JButton("讓自己復活");
  8.                 btn1.setBounds(10, 10, 175, 70);
  9.                 btn1.setEnabled(false);
  10.                 JButton btn2=new JButton("讓自己中毒");
  11.                 btn2.setBounds(10, 90, 175, 70);
  12.                 JFrame fm=new JFrame("中毒了!");
  13.                 fm.setBounds(100, 100, 200, 200);
  14.                 fm.setVisible(true);
  15.                 fm.setResizable(false);
  16.                 fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  17.                 fm.setLayout(null);
  18.                 fm.add(btn1);
  19.                 fm.add(btn2);
  20.                
  21.         }

  22. }
複製代碼

TOP

返回列表