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


I think there are some layers in each top level container:

the root panel
Layer Plane
Material Panel
Glass Panel

But I do not know the root panel is the top level container.

What is the relation between a pane and a container? In fact, when I return a panel with getContentPane () , then the object container !

If you look at the previous answer or link, then you can find between the lines that the question The real answer is:

The root level container is not , but the top-level container is is a root panel.

Because to implement all swing top-level containers ( JFrame , JDialog and JApplet ), The RootPaneContainer interface, this means that you can gain access to your root pane in general (there is no need to check that it is a JFrame or JDialog is ....)

The question about the second part is, the difference between the pane and the container, there really is no difference, the pane is a java.awt.Container (or to Subclass, especially javax.swing.JPa Neil ).

What is the requirement for Udnerast that there are different panes in a swinging top-level container (root, content, glass, layer), you have to keep an eye on the links posted in the previous answers On.


Comments