Solved

getContentPane() and getRootPane()

Posted on 2009-06-29
1
526 Views
Last Modified: 2012-05-07
Top level containers are such as the JFrame, JPanel and so on. Now we cannot directly add a component to a swing container (top level container). We can only add components to the container ContentPane by calling the getContentPane() method. Also a RootPane cannot have children. Therefore we cannot add components to the RootPane. Instead we can add components to the ContentPane of the RootPane. A RootPane is used to manage the interior of a frame such as the ContentPane, LayeredPane, GlassPane and MenuBar. Is this why we can set a JMenuBar on a RootPane?.
0
Comment
Question by:eugene007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
jwenting earned 50 total points
ID: 24743717
The RootPane contains everything else, including MenuBars etc.
The ContentPane contains window content only.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question