borderwindow.java

来自「这是一个java程序」· Java 代码 · 共 32 行

JAVA
32
字号
//演示BorderLayoutimport java.awt.*;public class BorderWindow extends Frame {    public BorderWindow() {        setLayout(new BorderLayout(5,5));        setFont(new Font("Helvetica", Font.PLAIN, 14));           add("North", new Button("North"));        add("South", new Button("South"));        //add("East", new Button("East"));        add("West", new Button("West"));		//add(new Button("Center"), "Center");        add("Center", new Button("Center"));    }    public boolean handleEvent(Event e) {        if (e.id == Event.WINDOW_DESTROY) {            System.exit(0);        }           return super.handleEvent(e);    }    public static void main(String args[]) {        BorderWindow window = new BorderWindow();        window.setTitle("BorderWindow Application");        window.pack();        window.show();    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?