What does getContentPane() return
It returns component's content pane
- To appear onscreen, every GUI component must be part of a containment hierarchy. A containment hierarchy is a tree of components that has a top-level container as its root.
- Each GUI component can be contained only once. If a component is already in a container and you try to add it to another container, the component will be removed from the first container and then added to the second.
- Each top-level container has a content pane that, generally speaking, contains (directly or indirectly) the visible components in that top-level container's GUI.
- You can optionally add a menu bar to a top-level container. The menu bar is by convention positioned within the top-level container, but outside the content pane. Some look and feels, such as the Mac OS look and feel, give you the option of placing the menu bar in another place more appropriate for the look and feel, such as at the top of the screen.
You can read about it more here
Why are we passing it to GroupLayout , i mean how getContentPane() is used to Group Layout
That's how GroupLayout is implemented.
Constructor:
GroupLayout(Container host)
Creates a GroupLayout for the specified Container. Please refere to javadoc for more