?? chap11-1.txt
字號:
// 程序11-1
import java.awt.*;
import java.applet.Applet;
import javax.swing.*;
public class showJFrame{
public static void main(String args[ ]){
showJFrame obj=new showJFrame( );
obj.testJFrame( );
}
public void testJFrame( ){
JFrame frame=new subJFrame("TestJFrame"); // 生成一個帶標題的框架
Container contentPane=frame.getContentPane( );// 取得內容格
contentPane.setLayout(new FlowLayout( )); // 設置布局管理器
contentPane.add(new JButton(" OK ")); // 添加組件
contentPane.add(new JTextField(10));
frame.setSize(200,100); // 設置框架顯示的頁面
frame.show( ); // 顯示框架
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -