Java Reference
In-Depth Information
Results of the Tutorial
Let's review what we have:
1.
In the Tutorials project, a new package called c5 with three new .java files called
MathTestApp, EnterEmpInfo and TNTButton.
2.
A printout of the MathTestApp source code.
3.
The source code in the three files should match the tutorials.
4.
Running EnterEmpInfo should generate the same results as the “Adding a Result Label”
tutorial steps 5 and 6.
Review Questions
1.
What is casting?
2.
What is a wrapper class? Give an example.
3.
What is concatenation?
4.
What do concatenation and addition have in common?
5.
Explain “pre-” and “post-” increments.
6.
Describe the appearance and function of a text field.
7.
Explain the difference between primitive and reference variables and give an example
of each.
Review Exercise
In this exercise, you will create an Enter Shipment Information frame re-using much of the code in ShipmentFrame.
1.
In the ReviewEx/src, create a new package called c5.
2.
Select all six classes in ReviewEx.c4, then copy and paste them into c5.
3.
In c5, right-click on ShipmentFrame and select copy.
4.
Right-click on ShipmentFrame again and select paste.
5.
At the Name Conflict window, specify EnterShipInfo as the new name.
In the c5.EnterShipInfo source code:
6.
Change the constructor to receive no parameters (instead of a Shipment object).
7.
Delete the statement that assigns s to ship .
Using VE, change c5.EnterShipInfo as follows:
8.
Add two more labels (above the three existing labels), and change their foreground colors
to blue.
9.
From top to bottom, name the five labels to empNumLbl, shipNumLbl, dateLbl, timeLbl,
supplLbl.
 
Search WWH ::




Custom Search