📄 gldemo.java
字号:
// GLDemo.java
import java.awt.*;
class GLDemo extends Frame
{
final static int NOGAPS = 0;
final static int GAPS = 1;
GLDemo (String title, int gapsOption)
{
super (title);
if (gapsOption == GAPS)
setLayout (new GridLayout (3, 3, 10, 10));
else
setLayout (new GridLayout (3, 3));
for (int i = 0; i < 9; i++)
add (new Button ("Button " + i));
setSize (250, 250);
setVisible (true);
}
public static void main (String [] args)
{
int option = NOGAPS;
for (int i = 0; i < args.length; i++)
if (args [i].equalsIgnoreCase ("GAPS"))
option = GAPS;
else
if (args [i].equalsIgnoreCase ("NOGAPS"))
option = NOGAPS;
new GLDemo ("GridLayout Demo", option);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -