Solved

getContentPane() and getRootPane()

Posted on 2009-06-29
1
518 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference between sorce folder and folder in eclipise 3 43
jboss 7.1 start up error 1 63
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 44
hashmap order 17 42
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

733 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