Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between the root pane and the top-level container, in Swing?

Tags:

swing

panes

I understand that every top level container has some layers:

root pane
layer pane
content pane
glass pane

but I don't understand whether the root pane is the top level container itself.

What is the relationship between a pane and a container? In fact, when I return a pane with getContentPane(), the object is of type Container!

like image 288
xdevel2000 Avatar asked May 17 '10 15:05

xdevel2000


1 Answers

You also have a JFrame. Read more on How to Use Root Panes.

RootPaneContainer From JRootPane:

The "heavyweight" components (those that delegate to a peer, or native component on the host system) are shown with a darker, heavier box. The four heavyweight JFC/Swing containers (JFrame, JDialog, JWindow, and JApplet) are shown in relation to the AWT classes they extend. These four components are the only heavyweight containers in the Swing library.

like image 194
Jonas Avatar answered Sep 28 '22 05:09

Jonas