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

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

  21. }
複製代碼

TOP

返回列表