What is the relation between ContentPane and JPanel?
It’s not two competing mechanisms – a JPanel is a Container (just look at the class hierarchy at the top of the JPanel javadocs). JFrame.getContentPane() just returns a Container to place the Components that you want to display in the JFrame. Internally, it’s using a JPanel (by default – you can change this by calling … Read more