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

  4.         public static void main(String[] args) {
  5.                 JFrame fm=new JFrame();
  6.                 JButton b1=new JButton("1");
  7.                 JButton b2=new JButton("2");
  8.                 b1.setBounds(10, 10, 175, 70);
  9.                 b1.setEnabled(false);
  10.                 b2.setBounds(10, 90, 175, 70);
  11.                 fm.setTitle("My First GUI App");
  12.                 fm.setLocation(100, 100);
  13.                 fm.setSize(200, 200);
  14.                 fm.setVisible(true);
  15.                 fm.setResizable(false);
  16.                 fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  17.                 fm.add(b1);
  18.                 fm.add(b2);
  19.         }

  20. }
複製代碼

TOP

返回列表