Beispiel #1
0
  public static void main(String[] args) throws Exception {
    if (args.length > 0 && args[0].equals(EXIT_AFTER_PAINT)) {
      exitAfterFirstPaint = true;
    }
    SwingUtilities.invokeAndWait(
        new Runnable() {

          public void run() {
            JFrame frame = new JFrame();
            frame.setTitle(resources.getString("Title"));
            frame.setBackground(Color.lightGray);
            frame.getContentPane().setLayout(new BorderLayout());
            Notepad notepad = new Notepad();
            frame.getContentPane().add("Center", notepad);
            frame.setJMenuBar(notepad.createMenubar());
            frame.addWindowListener(new AppCloser());
            frame.pack();
            frame.setSize(500, 600);
            frame.setVisible(true);
          }
        });
  }