The JFrame class is slightly incompatible with java.awt.Frame. JFrame contains a JRootPane as it's only child. The contentPane should be the parent of any children of the JFrame. This is different than java.awt.Frame, e.g. to add a child to an AWT Frame you'd write:
frame.add(child);
However using JFrame you need to add the child to the JFrames contentPane instead:
frame.getContentPane().add(child);
The same is true for setting LayoutManagers, removing components, listing children, etc. All these methods should normally be sent to the contentPane() instead of the JFrame itself. The contentPane() will always be non-null. Attempting to set it to null will cause the JFrame to throw an exception. The default contentPane() will have a BorderLayout manager set on it.
Please see the JRootPane documentation for a complete description of the contentPane, glassPane, and layeredPane properties.