Home

 

Importing the graphical user interface and control classes

In this section, we complete the graphical user interface (GUI) for the Java EE application client. This sample uses Swing components for the user interface.

Because this chapter focuses on the aspects relating to development of Java EE application clients, we import the finished user interface and focus on implementing the code for accessing the EJBs.

To import the framework classes for the Java EE application client, do these steps:

In the Enterprise Explorer, right-click RAD75AppClient and select New Æ Package. Type itso.rad75.client.ui as Name and click Finish.

Right-click itso.rad75.client.ui, and select Import.

In the Import dialog, expand General Æ File System and click Next.

In the Import file dialog, click Browse to locate c:\7672code\appclient.

Select AccountTableModel and BankDesktop, and click Finish (Figure | 7-7).

Figure 17-7 Import existing GUI class

Two classes have been imported to the RAD75AppClient project:

itso.rad75.client.ui.BankDesktop-This is a visual class, extending the Swing JFrame, that contains the view for the Java EE application client.

itso.rad75.client.ui.AccountTableModel-This is an implementation of the interface javax.swing.table.AbstractTableModel. The class provides the relevant TableModel interface for a JTable, given an array of Account instances.
ibm.com/redbooks