📄 firstswingdemo.java
字号:
package swing.first;
import javax.swing.JFrame;
import javax.swing.JLabel;
import swing.WindowDestroyer;
/**
A simple demonstration of a window constructed with Swing.
*/
public class FirstSwingDemo
{
public static final int WIDTH = 300;
public static final int HEIGHT = 200;
public static void main(String[] args)
{
JFrame myWindow = new JFrame( );
myWindow.setSize(WIDTH, HEIGHT);
JLabel myLabel =
new JLabel("Please don't click that button!");
myWindow.getContentPane( ).add(myLabel);
WindowDestroyer myListener = new WindowDestroyer( );
myWindow.addWindowListener(myListener);
myWindow.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -