title: Trouble with finding event using ActionListener
body: <p>I'm just beginning to work with JSwing and trying to learn how to deal with buttons and such, so all critiques will be appreciated and I'll apologize in advance for any basic errors. I'm only trying to create a basic JFrame with two buttons with different outcomes. For some reason the method actionPerformed can not find the button "pressme" even though I use the Action Listener. Can anyone help me find the solution to this? Thank you in advance!
  -Nick </p>
  
  <pre><code>    import java.util.Scanner;
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;
      class JPanel  extends JFrame implements ActionListener
      { 
        public JPanel createContentPane(){
          JPanel pane = new JPanel();
          Container con = this.getContentPane();
          JPanel titlePanel = new JPanel();
              titlePanel.setLayout(null);
              titlePanel.setLocation(10, 0);
              titlePanel.setSize(250, 30);
              pane.add(titlePanel);
          JLabel answer = new JLabel("");
              pane.add(answer);
          JLabel label1 = new JLabel("Is Ms. Stilman a savage?",            JLabel.CENTER);
              label1.setSize(150, 15);
              label1.setLocation(250, 10);
              titlePanel.add(label1);
          JButton pressme = new JButton("Nah, what are you talking         about?");
              pane.add(pressme);
              pressme.setMnemonic('P');
              pressme.addActionListener(this);
              pressme.setLocation(250, 10);
              pressme.requestFocus();
          JButton secondpress = new JButton("Yea she's a hardcore savage.");
              pane.add(secondpress);
              secondpress.addActionListener(this);
              secondpress.setLocation(250, 10);
              secondpress.requestFocus();
                }
                public void actionPerformed(ActionEvent event)  {
            Object source = event.getSource();
            if (source == pressme) {
                answer.setText("Button pressed!");
                JOptionPane.showMessageDialog(null, "You're wrong and probably a scrub.", "Message Dialog",
                        JOptionPane.PLAIN_MESSAGE); setVisible(true);
            }
            else if (source == secondpress) {
                answer.setText("Button pressed!");
                JOptionPane.showMessageDialog(null, "Oh ya for sure.",         "Message Dialog",
                JOptionPane.PLAIN_MESSAGE); setVisible(true);
            }
        }
        public static void createAndShowGui(){
         JFrame Frame1 = new JFrame("Button Press Test"); 
              setContentPane(demo.createContentPane());
              setSize(500, 300);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
              setVisible(true);
        }
      }
  </code></pre>