created some dividers

git-svn-id: svn://anubis/gvsu@437 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh 2009-10-04 20:54:32 +00:00
parent 7a2e468191
commit 5efa416c43
2 changed files with 12 additions and 1 deletions

View File

@ -13,6 +13,8 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
{
private RetirementCalculatorModel myModel;
protected JComponent makeDivider() { return new JLabel(" "); }
public RetirementCalculatorPanel()
{
super(new BorderLayout());
@ -47,6 +49,8 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
c.gridy++;
c.gridwidth = 2;
inner.add(makeDivider(), c);
c.gridy++;
inner.add(new JLabel("What is your expected annual income after retirement -"), c);
c.gridwidth = 1;
c.gridy++;
@ -78,11 +82,17 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
c.gridx--;
c.gridy++;
c.gridwidth = 2;
inner.add(makeDivider(), c);
c.gridwidth = 1;
c.gridy++;
c.weightx = 0.0;
inner.add(new JLabel("At what age do you expect to retire?", SwingConstants.RIGHT), c);
c.gridx++;
c.weightx = 1.0;
field = new JSpinner(new SpinnerNumberModel(65, 0, 150, 1));
Integer[] retirement_age_choices = { 55, 60, 65, 70 };
field = new JComboBox(retirement_age_choices);
inner.add(field, c);
c.gridx--;
c.gridy++;

View File

@ -33,6 +33,7 @@ public class RetirementCalculatorModel
setField("age", 30);
setField("retirement age", 65);
setField("savings", 0);
setField("life expectancy", 82);
calculate();
}