返回列表 發帖
  1. import javax.swing.JFrame;
  2. import javax.swing.JButton;
  3. public class A77
  4. {

  5.         public static void main(String[] args)
  6.         {
  7.                
  8.                 JButton btn1=new JButton("A");
  9.                 JButton btn2=new JButton("B");
  10.             btn1.setBounds(10,10,175,70);
  11.             btn1.setEnabled(false);
  12.             btn2.setBounds(10,90,175,70);
  13.             
  14.             
  15.             
  16.                 JFrame fm=new JFrame("按鈕練習");
  17.                 fm.setBounds(100,100,200,200);
  18.                 fm.setVisible(true);
  19.                 fm.setResizable(false);
  20.                 fm.setLayout(null);
  21.                 fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  22.                 fm.add(btn1);
  23.         fm.add(btn2);                  
  24.         }
複製代碼

TOP

返回列表