返回列表 發帖
本帖最後由 許逸群 於 2015-5-2 15:09 編輯
  1. package ch70;
  2. import javax.swing.JFrame;
  3. import javax.swing.JButton;
  4. public class ch70
  5. {

  6.         public static void main(String[] args)
  7.         {
  8.         JFrame f1=new JFrame("視窗一");
  9.         JButton b1=new JButton("按鈕一");
  10.         JButton b2=new JButton("按鈕二");

  11.         b1.setBounds(10,10,175,70);
  12.         b1.setEnabled(false);
  13.         b2.setBounds(10,90,175,70);
  14.         
  15.         f1.setBounds(100,100,200,200);
  16.         f1.setVisible(true);
  17.         f1.setResizable(false);
  18.         f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  19.         f1.setLayout(null);
  20.         f1.add(b1);
  21.         f1.add(b2);
  22.      
  23.         }

  24. }
複製代碼

TOP

返回列表