📄 sketchframe.java
字号:
// Frame for the Sketcher application
import javax.swing.*;
public class SketchFrame extends JFrame
{
// Constructor
public SketchFrame(String title)
{
setTitle(title); // Set the window title
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setJMenuBar(menuBar); // Add the menu bar to the window
JMenu fileMenu = new JMenu("File"); // Create File menu
JMenu elementMenu = new JMenu("Elements"); // Create Elements menu
menuBar.add(fileMenu); // Add the file menu
menuBar.add(elementMenu); // Add the element menu
}
private JMenuBar menuBar = new JMenuBar(); // Window menu bar
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -