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


  3. public class Ch01 {

  4.         public static void main(String[] args) {      
  5.         JButton btn1=new JButton("按鈕一");
  6.         btn1.setBounds(10, 10, 220, 80);
  7.         btn1.setEnabled(false);
  8.         
  9.         JButton btn2=new JButton("按鈕二");
  10.         btn2.setBounds(10, 100, 220, 80);
  11.         
  12.                 JFrame fm=new JFrame("JButton");     
  13.         fm.setVisible(true);
  14.         fm.setBounds(250, 150, 257, 230);
  15.         fm.setResizable(false);
  16.         fm.setLayout(null);
  17.         fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  18.         fm.add(btn1);
  19.         fm.add(btn2);
  20.         }
  21. }
複製代碼

TOP

返回列表