Please help me understand. What is the difference between getContentPane() and JPanel? As far as I know, getContentPane() is a method which does the same things like JPanel, like they are being used for including some components like "buttons", "radio buttons", etc?
Asked
Active
Viewed 397 times
0
-
I think this is what you are looking for: https://stackoverflow.com/questions/2432839/what-is-the-relation-between-contentpane-and-jpanel – Jsandesu Oct 23 '17 at 18:50
1 Answers
0
Basically it follows an hierachy:
JFrame > JPanel > ContentPane > other elements
The JPanel is almost the same thing as a content pane, but rather then an object itself, it's treated more like an attribute.
You should check out the official documentation for JFrame at https://docs.oracle.com/javase/7/docs/api/javax/swing/JFrame.html

João Pedro Abubakir
- 56
- 1
- 7