title: JFrame opening a JApplet
body: <p>I am making a program in java which the JButton in JFrame will hide the JFrame and run a JApplet </p>
  
  <p>I have done something like </p>
  
  <pre><code>OpenButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e){
  
                  hide();
                  JApplet startGame = new MainApplet();
  
                  startGame.init();
                  startGame.start();
          }
  });
  </code></pre>
  
  <p>what am I doing wrong? thank you</p>