Creating a New Form

  1. Choose File and choose New from the main menu.
  2. In the New wizard, expand the GUI Forms node and select a form template. You can choose Swing or AWT templates, sample pre-built application skeletons, or any class that is based on the JavaBeansTM component architecture.

    The various form template options are described in more detail below.

  3. Complete the steps of the New Wizard. You can use the Help button in the wizard for more help on each step.

    After you complete the steps of the New wizard, a blank form of the selected type is created and opened in the Form Editor window.

The first set of templates you can choose from (those starting with J) are Swing form templates. Swing forms use the latest Java Foundation Class (JFC) components for building GUIs that are implemented without native code. Native code is code that refers to methods of a specific operating system or that is compiled for a specific processor.

The AWT (Abstract Window Toolkit) is the original Java class library for building Java GUIs. The AWT contains native code.

Tip You should use only AWT components in AWT forms and only Swing components in Swing forms. It is possible to mix AWT and Swing components in one form, but doing so can cause repaint problems at both design time and run time.

The following table lists the types of form templates you can choose. Each differs in the design time and run time look of the form and in the code generated for the form's class.

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

The base class being extended must be compiled and have a public constructor without parameters. It can be visual or nonvisual. You can also create a plain container for beans by using java.lang.Object as the base class.

The fully qualified name of the base class must be specified in the Superclass field, which is found in the Basic Class Definition pane (step 3) of the New wizard.

AWT Forms Visual forms that are parallel to the Swing forms described above, but that are based on the AWT. The AWT forms include Applet, Dialog, Frame, and Panel.
Sample Forms A few customized sample forms. The sample forms 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
Form Editor
Templates
Creating a Multiple Document Interface (MDI) Application

Legal Notices