返回列表 發帖
  1. package ch05;

  2. import javax.swing.JButton;
  3. import javax.swing.JFrame;

  4. public class ch06 {

  5.         public static void main(String[] args) {
  6.         JFrame fm=new JFrame("視窗");
  7.         JButton bt1=new JButton("按鈕一");
  8.         JButton bt2=new JButton("按鈕二");
  9.        
  10.         bt1.setBounds(10, 10, 175, 70);
  11.         bt1.setEnabled(false);
  12.         bt2.setBounds(10, 90, 175, 70);
  13.        
  14.        
  15.         fm.setBounds(100, 100, 200, 200);
  16.         fm.setVisible(true);
  17.         fm.setLayout(null);
  18.         fm.setResizable(true);
  19.         fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  20.         fm.add(bt2);
  21.         fm.add(bt1);
  22.         }

  23. }
複製代碼

TOP

返回列表