?? gridwindow.java
字號:
/* * Swing version. */import java.awt.*;import java.awt.event.*;import javax.swing.*;public class GridWindow extends JFrame { boolean inAnApplet = true; public GridWindow() { Container contentPane = getContentPane(); contentPane.setLayout(new GridLayout(0,2)); contentPane.add(new JButton("Button 1")); contentPane.add(new JButton("2")); contentPane.add(new JButton("Button 3")); contentPane.add(new JButton("Long-Named Button 4")); contentPane.add(new JButton("Button 5")); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { if (inAnApplet) { dispose(); } else { System.exit(0); } } }); } public static void main(String args[]) { GridWindow window = new GridWindow(); window.inAnApplet = false; window.setTitle("GridLayout"); window.pack(); window.setVisible(true); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -