The ActionListener
for the income JTextField
relys on the user pressing ENTER to set the income
. If this doesnt happen then assignment
tax = income * 0.10;
will produce a value tax
equal to 0
.
Ensure that the assignment for income
occurs at the start of the ItemListener
income = Integer.parseInt(jtfIncome.getText());
before the tax calculation is made.