Taken from official Java API doc:
The JApplet class is slightly incompatible with java.applet.Applet. JApplet contains a JRootPane as it's only child. The contentPane should be the parent of any children of the JApplet. This is different than java.applet.Applet, e.g. to add a child to an an java.applet.Applet you'd write:
applet.add(child);
However using JApplet you need to add the child to the JApplet's contentPane instead:
applet.getContentPane().add(child);