title: reusing action listener and jframe in main class
body: <p>So if someone would take a look at the code below and give me hand I would owe you my life. So here's the issue, obviously I can get this to work if I were to put <code>playerCreationSelection</code>in its own class, my questions is getting it to work, inside <code>class superClass</code> I cannot for the life of me move things around to make it work. Any help would be great, thanks everyone!</p>
  
  <p><strong>forgot to actually put what goes wrong! So what will happen is it says <code>playerCreationSelection</code> is not a symbol</strong>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>public class superClass
  {
     public static void main(String[] args) 
     {
         playerCreationSeletion gui = new playerCreationSeletion();  
     }
  
     public class playerCreateSelection extends JFrame implements ActionListener 
     {
     
        //create label
        public JLabel playerCreatedLabel;
        public void playerCreationSeletion()
        {
            setSize(WIDTH,HEIGHT);
            WindowDestroyer listener = new WindowDestroyer();
            addWindowListener(listener);
              
            Container contentPane = getContentPane();
            contentPane.setBackground(Color.DARK_GRAY);
              
            contentPane.setLayout(new FlowLayout());
              
            //create button
            JButton playerCreationButton = new JButton("Create New Player");
            playerCreationButton.addActionListener(this);
            contentPane.add(playerCreationButton);
              
            //create label
            playerCreatedLabel = new JLabel("Welcome New Player!");
            playerCreatedLabel.setVisible(false);
              
          }
          public void actionPerformed(ActionEvent e)
          {
              String actionCommand = e.getActionCommand();
              Container contentPane = getContentPane();
              if(actionCommand.equals("Create New Player"))
              {
                  contentPane.setBackground(Color.LIGHT_GRAY);
                  playerCreatedLabel.setVisible(true);
              }
          }
       }
    }</code></pre>
  </div>
  </div>
  </p>