?
Solved

getContentPane() and getRootPane()

Posted on 2009-06-29
1
Medium Priority
?
537 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 200 total points
ID: 24743717
The RootPane contains everything else, including MenuBars etc.
The ContentPane contains window content only.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

752 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