|
I would never use Container contentPane = getContentPane().
Originally posted by Josh Rehman:
Gregg is wrong. getContentPane() does not return an AWT component. It returns an instance of JPanel. You can always do this:
JPanel is a subclass of java.awt.Container. Perhaps that's where the confusion comes from.
But JFrame doesn't have any special class for it's contentPane member. It's just a JPanel.
getContentPane
public Container getContentPane()Returns the contentPane object for this frame.
Specified by:
getContentPane in interface RootPaneContainer
Returns:
the contentPane property
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I am a man of mystery. Mostly because of this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|