This section teaches you to create a container using one of the GUI templates available in the IDE.
![]() |
Before you create the container, resize both the IDE and the online help windows so that the windows do not overlap. Grab any of the corners of each window with the mouse to resize it. Resizing the windows allows you to read the tutorial and follow the steps in the IDE at the same time. |
The top-level container that you create holds the other components (button and label) in your application. You create the container using the JFrame component and place the container in the colorswitch package. (A package is a group of related Java classes and interfaces.)
To create the container:
The New wizard is displayed.
A description of the JFrame component appears in the Template Description pane.
A colorswitch object is added to the sampledir directory in the Filesystems pane of the Explorer window. Expand the colorswitch node to see the nodes for the ColorSwitch class object and the top-level GUI container, ColorSwitch JFrame.
In addition, the workspace automatically changes to GUI editing, and the Form Editor and Source Editor are displayed.
The Form Editor contains three panes: the Form Designer, the Component Inspector, and the Component Palette. The Form Designer is the layout area in which you create the ColorSwitch GUI. The Component Inspector provides a visual representation of the components in your application and enables you to edit their properties. The Component Palette is located above the Form Designer pane. The Component Palette contains numerous tabs for various AWT, Swing, and JavaBeans components, along with a selection of layout managers and border styles.
The Source Editor shows the Java source code for the JFrame component. You can type only in the white areas of the Source Editor.
Next: Selecting a Layout Manager
Back: Creating the ColorSwitch Application |
See also | |
---|---|
Templates
Designing Java GUIs |