Java Reference
In-Depth Information
3.
Increase the length of empCSZTF to 150.
4.
In c5, create a new visual class called TNTButton, and define its superclass as
java.awt.Button.
5.
Define TNTButton's properties as follows and save the class:
Size: 50, 25 Font: Tahoma, 14
6.
In c5, change the ExitButton class so it is a subclass of TNTButton and comment out the
setBounds statement.
This will ensure that the Exit button inherits the size from TNTButton.
7.
In EnterEmpInfo, change the getGrossBtn method so that:
grossBtn is defined as a new TNTButton, not as a java.awt.Button
grossBtn does not have a setBounds or setSize statement
grossBtn has a setLocation statement that defines the location as 177, 365
8.
Save all the changes and run EnterEmpInfo as a Java application.
The frame should look like Figure 5-8 .
Figure 5-8.
Dang, another problem! Because we commented out the Exit button's setBounds statement, the default location
was never set and the exit button isn't placed on the frame.
 
Search WWH ::




Custom Search