bldemo.java
来自「java 完全探索的随书源码」· Java 代码 · 共 43 行
JAVA
43 行
// BLDemo.java
import java.awt.*;
class BLDemo extends Frame
{
final static int NOGAPS = 0;
final static int GAPS = 1;
BLDemo (String title, int gapsOption)
{
super (title);
if (gapsOption == GAPS)
setLayout (new BorderLayout (10, 10));
else
setLayout (new BorderLayout ());
add (new Button ("North"), "North");
add (new Button ("South"), BorderLayout.SOUTH);
add (new Button ("Center"), "Center");
add (new Button ("West"), BorderLayout.WEST);
add (new Button ("East"), "East");
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 BLDemo ("BorderLayout Demo", option);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?