sketchframe.java

来自「Java Classic Examples是我买的两本书:《JAVA经典实例》和」· Java 代码 · 共 23 行

JAVA
23
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?