Java Reference
In-Depth Information
Figure 6-19.
6.
Change the source code to add the ActionListener to the two new buttons.
7.
In the actionPerformed method, comment out the println statement.
8.
In the actionPerformed method, enter a nested if that uses the ActionEvent's getSource
method to determine which button was clicked and perform the following logic:
If the Display button is clicked
Create an EmployeeFrame object with the text field information from the EnterEmployeeInfo frame and assign it
to a variable called ef.
Else Add the result label to the frame
If the Gross button is clicked
Calculate doubleGross and set the result label's text
Else If the TaxAmt button is clicked
Run the Employee fedTaxCalc method and set the result label text to “The
Federal Tax amount is: $” concatenated to the amount returned by fedTaxCalc
The flowchart for this logic can be seen in Figure 6-20 .
 
Search WWH ::




Custom Search