Creating a New Form

See Also

In the IDE, you can create JFC/Swing or AWT (Abstract Window Toolkit) forms, pre-built sample application skeletons, or any class that is based on the JavaBeansTM component architecture using the provided templates.

To create a new GUI form in the IDE:

  1. Choose File > New File from the main menu.
  2. In the New wizard's Project combo box, select the project for which you want to create the form.
  3. Expand the Java GUI Forms node in the Categories pane and select the desired form template. Click Next.
  4. Enter the GUI form's class name and location. Click Finish.
  5. The IDE creates a blank form of the selected type and opens it in the GUI Builder view of an Editor tab.

GUI Form Types in the IDE:

The following table lists the types of form templates available in the IDE. Each differs in the design time and run time look of the form as well as in the code generated for the form's class.

Form Type Description
JApplet Program run by a Java-enabled web browser or other applet viewer.
JDialog Modal or modeless window for collecting user input.
JFrame Top-level application window.
JInternalFrame An internal frame that can be placed on a JDesktopPane component to create an MDI application.
JPanel Lightweight container for holding parts of an interface. In turn, the container can be used in any other container, such as a JFrame, JPanel, JApplet, or JDialog component.
Bean Form

The template used to create a new form based on any JavaBeans component. The new form can be visual or nonvisual. Specify the class in the Superclass field on the Form Superclass page of the New wizard. The bean class that you specify when creating the new form must be in the classpath and must be already compiled.

A bean is any class that complies with the JavaBeans component architecture. A bean must have a public constructor without parameters. Use any JFC/Swing component as an example of a JavaBeans class. For example, you can use javax.swing.JButton to create a form that will produce a customized button.

Using this template, you can also create a plain container for holding beans by specifying java.lang.Object as the superclass.

AWT Forms Visual forms that are based on the AWT. The AWT forms include Applet, Dialog, Frame, and Panel.
Sample Forms Customized sample forms that include a JFrame-based application with three menus, a JFrame application that can be used as the main window for an MDI application, and a dialog box with OK and Cancel buttons.
See Also
Working with Containers
About Layout Managers
Creating a Multiple Document Interface (MDI) Application

Legal Notices