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 JavaBeans component architecture using the provided templates.
You can create forms within an existing project or you can create a new project that is based on the Swing Application Framework and that already contains a skeleton form.
To create a new project that contains a skeleton form:
The Basic Application shell provides a skeleton application based on the Swing Application Framework.
The Database Application shell enables you to quickly generate an interface for a simple CRUD (create, read, update, delete) application that is based on a single database table. It implements a JTable component for viewing contents of the database table; text fields for entering data; and buttons for saving records, adding new records, and so on.
The IDE creates a project with a skeleton form of the selected type and opens the form in the Design view of the Source Editor.
To create a new GUI form in an existing project:
The IDE creates a blank form of the selected type and opens and opens the form in the Design view of the Source Editor.
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. |