Java Reference
In-Depth Information
Review Exercise
In this exercise, you will use VE to create a better-looking frame for the Shipment application. In addition, a display
button will be added, and instead of immediately displaying the shipment information, the user will be required to
click the display button to see the information.
1.
Using RAD, create a new package called c4 in the ReviewEx/src.
2.
Select all three classes in c3 then copy and paste them into c4.
3.
Copy the UsefulFrame and ExitButton classes from Tutorial/src/c4 to ReviewEx/src/c4.
4.
In ReviewEx/src/c4, create a new visual Class called ShipmentFrame, specifying:
Frame as the superclass
public for the class access modifier
Create Inherited abstract methods
An ActionListener interface
Notice in the source code that RAD created a constructor, an initialize, and an actionPerformed method.
In c4/ShipmentFrame using the VE design pane:
1.
Select the frame and display the Properties view.
2.
In the Properties view, change the frame title to Shipment Information, layout to null,
and the size to 400 by 350.
3.
Create a label called headerLbl that has the following properties:
300 by 40 in size
Background color is red
Located just below the frame title bar (38 pixels from the top) and centered horizontally
Contains the text “TNT Salvage”
The text is centered within the label
The text is Arial and 24 in size
4.
In the source code, change the superclass to UsefulFrame and delete the Frame import
statement.
5.
Create and add a button called displayButton to the frame. The button's properties should
be as follows:
60 by 20 in size
Centered horizontally
Its bottom edge should align with the Exit button's bottom edge
Have the text “Display” appear on the button
 
Search WWH ::




Custom Search