📄 ex_3a.java
字号:
// Based on Holmes text chap_10\Ex_1.java
// program to demonstrate the construction of a container and a button
import java.awt.*;
class Gui extends Frame
{
// constructor
public Gui(String s)
{
super(s);
setBackground(Color.black);
setLayout(new FlowLayout());
Button pushButton = new Button("press me");
add(pushButton);
}
}
class Ex_3a
{
public static void main(String[] args)
{
Gui screen = new Gui("Example 1");
screen.setSize(500,100);
screen.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -