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 HashMap<String, JComponent> myFields;
|
||||
private JButton myCalculateButton;
|
||||
private JButton myPrintButton;
|
||||
private JButton myResetButton;
|
||||
|
||||
public RetirementCalculatorPanel()
|
||||
{
|
||||
@ -168,14 +171,17 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
|
||||
JPanel buttons = new JPanel();
|
||||
buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
|
||||
buttons.add(Box.createHorizontalGlue());
|
||||
JButton button = new JButton("Calculate");
|
||||
buttons.add(button);
|
||||
button = new JButton("Print");
|
||||
myCalculateButton = new JButton("Calculate");
|
||||
myCalculateButton.addActionListener(this);
|
||||
buttons.add(myCalculateButton);
|
||||
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
|
||||
buttons.add(button);
|
||||
button = new JButton("Reset");
|
||||
myPrintButton = new JButton("Print");
|
||||
myPrintButton.addActionListener(this);
|
||||
buttons.add(myPrintButton);
|
||||
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());
|
||||
c.gridwidth = 2;
|
||||
inner.add(buttons, c);
|
||||
|
Loading…
x
Reference in New Issue
Block a user