返回列表 發帖
  1. import javax.swing.JButton;
  2. import javax.swing.JFrame;


  3. public class Ch75 {

  4.         public static void main(String[] args)
  5.         {
  6.                 JButton btn1 = new JButton("按鈕一");
  7.                 btn1.setBounds(10, 10,175, 70);
  8.                 btn1.setEnabled(false);
  9.                
  10.                 JButton btn2 = new JButton("按鈕二");
  11.                 btn2.setBounds(10, 90, 175, 70);
  12.                
  13.                 JFrame fm = new JFrame("視窗一");
  14.                 fm.setBounds(100,100,200,200);
  15.                 fm.setVisible(true);
  16.                 fm.setResizable(true);
  17.                 fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  18.                 fm.setLayout(null);
  19.                 fm.add(btn1);
  20.                 fm.add(btn2);
  21.         }

  22. }
複製代碼

TOP

返回列表