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

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

  23. }
複製代碼

TOP

返回列表