exgui.java

来自「清华大学辛运帏java程序设计第二版源代码」· Java 代码 · 共 25 行

JAVA
25
字号
import java.awt.*;

public class ExGui {
	private Frame f;
	private Button b1;
	private Button b2;

	public static void main(String args[]) {
		ExGui that = new ExGui( );
		that.go( );
	}

	public void go( ) {
		f = new Frame ("GUI example");
		f.setLayout(new FlowLayout( ));
		b1 = new Button("Press me");
		b2 = new Button("Don′t press Me");

		f.add(b1);
		f.add(b2);
		f.pack( );
		f.setVisible(true);
	}

}

⌨️ 快捷键说明

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