Solved

setting JFrame LayoutManager to NORTH

Posted on 2007-04-09
1
318 Views
Last Modified: 2013-11-23
Hi, experts:

This is going to sound really dumb.  I have some old code that looks like this:

               JFrme outer = new JFram(BorderLayout.NORTH);

This is the stupid part.  I already have a JFrame called outer.  Now all I want to do is set its BorderLayout to NORTH.  I don't want to put any buttons on it or anything.  It is meant to be an MDI.  I cannot find any information anywhere that allows me to set it to NORTH without putting a button it.

FRUSTRATED!

P.S. Thanks for your help.
0
Comment
Question by:pdlarue
[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 3

Accepted Solution

by:
RizwanKhalid earned 50 total points
ID: 18887941
You can only set the layouts of panels and not frames. Every frame has a deafult rootpane, that is hidden from the user in such a way that if you set the borderlayout (or any layout) of the frame, it will set the layout of this rootpane. Now if you make a JFrame an MDI or do not put any controls on the frame, then it does not have any rootpane. So if you set it layout to anything it will not do it as it does not have the rootpane. That is why it requires to have at least one control before it allows to set layouts.

Hope this helps.
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

626 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