Don't set the contentPane to be the panel. Instead use - getContentPane().add(jPanel3);
As a matter of fact setting the content pane to a JPanel does work. All the JFrame
wants is that its content pane should be a JComponent and it must be opaque.
The JFrame's add() method delegates to its content pane's add() method and all
JComponents have such a method (inherited from the Container class), so there's
no problem here.
You could wonder why to create a JPanel in the first place because the original
content pane is a JComponent and thus a Container (with a BorderLayout) so it
can do the job as well.
kind regards,
Jos