Now that you know that database access is set up properly,
you are ready to build the user interface for the StaffList
application. At this point, complete keyboard sequences for standard
operations are not shown. If you have forgotten how to do these
standard operations, reread the ToDoList example, starting with Introduction to building your first applet.
Setting up the composite
- Create a new project named Data Access Example.
- Create a new package named DAStaffList.
- Create a new class as follows:
- In the Class name field, type StaffList
- In the Superclass field, type
com.sun.java.swing.JFrame
- Click Browse the class when finished and Compose the class
visually.
Dropping and setting beans in the Visual Composition Editor
- Add a title to the JFrame bean by editing its title
property. In this example, change the title to Staff
List.
- Drop two JLabel beans. Edit their properties as follows:
- Change the text property for the first one to Name
- Change the text property for the second one to
Position
- Resize the labels as necessary so that the entire labels are
displayed.
- Drop two JTextField beans. Change their names to NameTF and
PositionTF, respectively.
- From the Database category of the beans palette, select
a DBNavigator bean and drop it in the JFrame bean.
- Align and move components around until they look something like
this:

- Save your work.
