📄 twoframes.java
字号:
import javax.swing.*;
public class TwoFrames extends JFrame {
public TwoFrames() {
super("First Frame");
setSize(350, 100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SecondFrame two = new SecondFrame();
setVisible(true);
two.setVisible(true);
}
public static void main(String[] arguments) {
TwoFrames tf = new TwoFrames();
}
}
class SecondFrame extends JFrame {
SecondFrame() {
super("Second Frame");
setSize(150, 80);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -