返回列表 發帖
  1. import javax.swing.JButton;
  2. import javax.swing.JFrame;
  3. public class Ch76 {
  4.                 public static void main(String[] args) {
  5.                 JButton bn1=new JButton("button1");
  6.                 bn1.setBounds(10, 10, 220, 70);
  7.             bn1.setEnabled(false);
  8.                
  9.                 JButton bn2=new JButton("button2");
  10.                 bn2.setBounds(10, 90, 220, 70);
  11.                
  12.             JFrame fm=new JFrame("Button");
  13.             fm.setBounds(100, 100, 250, 200);
  14.             fm.setVisible(true);
  15.             fm.setResizable(false);
  16.             fm.setLayout(null);
  17.             fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  18.             fm.add(bn1);
  19.             fm.add(bn2);
  20.         }

  21. }
複製代碼

TOP

返回列表