title: setDefaultButton on JPanel in Applet
body: <pre><code>public class test_Applet extends Applet {
      public void init(){
          JPanel test = new testPanel();
          test.setVisible(true); 
          this.add(test);
          System.out.println(test.getRootPane());
          //returns null
      }
  
  }
  </code></pre>
  
  <p>I need a way to change the DefaultButton on my JPanel, so that when someone pressed enter a button in the JPanel is pressed. However, I can't do that since getRootPane() returns null.</p>