本帖最後由 許逸群 於 2015-5-2 15:09 編輯
- package ch70;
- import javax.swing.JFrame;
- import javax.swing.JButton;
- public class ch70
- {
- public static void main(String[] args)
- {
- JFrame f1=new JFrame("視窗一");
- JButton b1=new JButton("按鈕一");
- JButton b2=new JButton("按鈕二");
- b1.setBounds(10,10,175,70);
- b1.setEnabled(false);
- b2.setBounds(10,90,175,70);
-
- f1.setBounds(100,100,200,200);
- f1.setVisible(true);
- f1.setResizable(false);
- f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- f1.setLayout(null);
- f1.add(b1);
- f1.add(b2);
-
- }
- }
複製代碼 |