返回列表 發帖
  1. import javax.swing.*;
  2. import java.util.Random;
  3. public class Ch100 {
  4.         public static void main(String[] args) {                  
  5.       
  6.                      JButton bt1=new JButton("BUTTON1");
  7.                      bt1.setBounds(10, 10, 175, 70);
  8.                      bt1.setEnabled(false);
  9.                      
  10.                      JButton bt2=new JButton("BUTTON1");
  11.                      bt2.setBounds(10, 90, 175, 70);
  12.                      bt2.setEnabled(true);
  13.                      
  14.                  JFrame fram1=new JFrame("視窗1");
  15.                  fram1.setBounds(100, 100, 200, 200);
  16.                  fram1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  17.              fram1.setLayout(null);
  18.                  fram1.setVisible(true);
  19.                  fram1.setResizable(true);
  20.                  fram1.add(bt1);
  21.                  fram1.add(bt2);                        
  22.         }
  23. }
複製代碼

TOP

返回列表