IntelliJ IDEA 13.1 Web Help

To make your form work, you have to provide a runtime frame for it. The main() method for GUI forms takes care of creation and disposal of such frame.

To create a main() method for a form
  1. Open for editing the bound class of a form where you want to create the main() method.
  2. Press Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertCtrl+N or Alt+InsertAlt+InsertAlt+InsertCommand N or Control EnterControl N or Control EnterCommand N or Control Enter.
  3. On the pop-up menu, click Form main(). The following method is added to the source code:
                public static void main(String[] args) {
        JFrame frame = new JFrame("<class name>");
        frame.setContentPane(new <class name>().contentPane);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }
        

See Also

Procedures:

Web Resources: