返回列表 發帖
  1. import javax.swing.JFrame;
  2. import javax.swing.JButton;
  3. public class Ch77 {
  4.     public static void main(String args[]){
  5.             JFrame fm=new JFrame("按鈕元件");
  6.             JButton btn1=new JButton("按鈕一");
  7.             JButton btn2=new JButton("按鈕二");
  8.             fm.setBounds(100, 100, 200, 200);
  9.             fm.setVisible(true);
  10.             fm.setResizable(false);
  11.             fm.setLayout(null);
  12.             fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  13.             btn1.setBounds(10,10,175,70);
  14.             btn2.setBounds(10,90,175,70);
  15.             btn1.setEnabled(false);
  16.             fm.add(btn1);
  17.             fm.add(btn2);
  18.     }
  19. }
複製代碼

TOP

返回列表