ready to handle button presses
git-svn-id: svn://anubis/gvsu@440 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
3ee89f1571
commit
822355183a
@ -16,6 +16,9 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
|
|||||||
private JComponent makeDivider() { return new JLabel(" "); }
|
private JComponent makeDivider() { return new JLabel(" "); }
|
||||||
|
|
||||||
private HashMap<String, JComponent> myFields;
|
private HashMap<String, JComponent> myFields;
|
||||||
|
private JButton myCalculateButton;
|
||||||
|
private JButton myPrintButton;
|
||||||
|
private JButton myResetButton;
|
||||||
|
|
||||||
public RetirementCalculatorPanel()
|
public RetirementCalculatorPanel()
|
||||||
{
|
{
|
||||||
@ -168,14 +171,17 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
|
|||||||
JPanel buttons = new JPanel();
|
JPanel buttons = new JPanel();
|
||||||
buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
|
buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
|
||||||
buttons.add(Box.createHorizontalGlue());
|
buttons.add(Box.createHorizontalGlue());
|
||||||
JButton button = new JButton("Calculate");
|
myCalculateButton = new JButton("Calculate");
|
||||||
buttons.add(button);
|
myCalculateButton.addActionListener(this);
|
||||||
button = new JButton("Print");
|
buttons.add(myCalculateButton);
|
||||||
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
|
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
|
||||||
buttons.add(button);
|
myPrintButton = new JButton("Print");
|
||||||
button = new JButton("Reset");
|
myPrintButton.addActionListener(this);
|
||||||
|
buttons.add(myPrintButton);
|
||||||
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
|
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
|
||||||
buttons.add(button);
|
myResetButton = new JButton("Reset");
|
||||||
|
myResetButton.addActionListener(this);
|
||||||
|
buttons.add(myResetButton);
|
||||||
buttons.add(Box.createHorizontalGlue());
|
buttons.add(Box.createHorizontalGlue());
|
||||||
c.gridwidth = 2;
|
c.gridwidth = 2;
|
||||||
inner.add(buttons, c);
|
inner.add(buttons, c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user