返回列表 發帖
  1. import javax.swing.*;
  2. public class Ch77 {

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

  22. }
複製代碼
كخخخخخخخخخخخخخ

TOP

返回列表