added age field, resetting result box upon "Reset" click
git-svn-id: svn://anubis/gvsu@448 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
46b24609a4
commit
c11c661054
@ -76,6 +76,21 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
|
|||||||
c.gridx--;
|
c.gridx--;
|
||||||
c.gridy++;
|
c.gridy++;
|
||||||
|
|
||||||
|
c.weightx = 0.0;
|
||||||
|
inner.add(new JLabel("What is your age?", SwingConstants.RIGHT), c);
|
||||||
|
c.gridx++;
|
||||||
|
c.weightx = 1.0;
|
||||||
|
field = new JTextField();
|
||||||
|
myFields.put("age", field);
|
||||||
|
inner.add(field, c);
|
||||||
|
c.gridx--;
|
||||||
|
c.gridy++;
|
||||||
|
|
||||||
|
c.gridwidth = 2;
|
||||||
|
inner.add(makeDivider(), c);
|
||||||
|
c.gridwidth = 1;
|
||||||
|
c.gridy++;
|
||||||
|
|
||||||
c.weightx = 0.0;
|
c.weightx = 0.0;
|
||||||
inner.add(new JLabel("How much annual income will you want in retirement?", SwingConstants.RIGHT), c);
|
inner.add(new JLabel("How much annual income will you want in retirement?", SwingConstants.RIGHT), c);
|
||||||
c.gridx++;
|
c.gridx++;
|
||||||
@ -186,11 +201,11 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
|
|||||||
myCalculateButton = new JButton("Calculate");
|
myCalculateButton = new JButton("Calculate");
|
||||||
myCalculateButton.addActionListener(this);
|
myCalculateButton.addActionListener(this);
|
||||||
buttons.add(myCalculateButton);
|
buttons.add(myCalculateButton);
|
||||||
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
|
buttons.add(Box.createRigidArea(new Dimension(10, 0)));
|
||||||
myPrintButton = new JButton("Print");
|
myPrintButton = new JButton("Print");
|
||||||
myPrintButton.addActionListener(this);
|
myPrintButton.addActionListener(this);
|
||||||
buttons.add(myPrintButton);
|
buttons.add(myPrintButton);
|
||||||
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
|
buttons.add(Box.createRigidArea(new Dimension(10, 0)));
|
||||||
myResetButton = new JButton("Reset");
|
myResetButton = new JButton("Reset");
|
||||||
myResetButton.addActionListener(this);
|
myResetButton.addActionListener(this);
|
||||||
buttons.add(myResetButton);
|
buttons.add(myResetButton);
|
||||||
@ -293,6 +308,7 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
myNameField.setText("");
|
myNameField.setText("");
|
||||||
|
myResultBox.setText(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void print()
|
private void print()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user