my main Class reads like this
Expand|Select|Wrap|Line Numbers
- public static void main(String[] args) {
- JWindow MainWindow = new JWindow();
- MainWindow.setVisible(true);
- MainWindow.setSize(500,500);
- MainWindow.setLocation(100,100);
- ExitButton Fred = new ExitButton();
- MainWindow.add(Fred);
- }
Expand|Select|Wrap|Line Numbers
- public class ExitButton extends JButton implements ActionListener {
- JButton button = new JButton("Exit");
- ExitButton()
- {
- addActionListener(this);
- setSize(10,10);
- setVisible(true);
- }
- public void actionPerformed(ActionEvent evt)
- {
- if(evt.getSource()==button)
- {
- System.exit(0);
- }
- }
- }
More importantly than just fixing my code, I want to know what is wrong with it.
Thank You,
casey