top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are the various window panes available in swing?

0 votes
832 views
What are the various window panes available in swing?
posted May 30, 2017 by Pooja Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

There are 4 window panes: Glass pane, Root pane, Layered pane, and Content pane.
1) Glass Pane: The glass pane is useful when you want to be able to catch events or paint over an area that already contains one or more components. For example, you can deactivate mouse events for a multi-component region by having the glass pane intercept the events. Or you can display an image over multiple components using the glass pane.
2) Root Pane: When we create a JFrame object, a JRootPane is automatically created and it occupies the empty part of the frame. So, the JRootPane is like the base of the photo frame. This means that all the content in the frame should lie on top of it.
3) Layered Pane: A layered pane is a container with depth such that overlapping components can appear one on top of the other.Each root pane places its menu bar and content pane in an instance of JLayeredPane. The Z ordering that the layered pane provides enables behavior such as displaying popup menus above other components.
4) Content Pane: The ContentPane is implicitly called and the component is added to it. As the ContentPane has no default layout, the component takes up the entire area of the component pane.

enter image description here

answer May 31, 2017 by Naziya Raza Khan
...