Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

Can a JDesktopPane be added to different layout manager?

Thread view: 
Bob Wightman - 11 Jan 2004 18:54 GMT
I have a JDesktopPane that contains a series of JInternalFrames. These
frames contain various tables of data. I wish to allow the user to
validate the data in a table before they save it to file. I am
currently placing the results of the validation in another frame and
displaying it on the JDesktopPane.

However I would prefer to display the results in a separate area to
one side of the desktop. To do this it would seem that I should create
a panel (with a layout manager) and add my desktop to that. Then when
the results of a validation request are ready, add a component holding
those to the side of the desktop. Unfortunately I cannot get this to
work!

A rough outline of the code I have tried:

JPanel panel = new JPanel(new BorderLayout()); // for instance
.....
panel.add(desktop, BorderLayout.CENTER);
....

JTextPane result = table.validateData();
JScrollPane checkResult = new JScrollPane(result);
panel.add(checkResult, BorderLayout.EAST);

Unfortunately nothing appears, neither the desktop nor the results.

Bob
Bob Wightman - 12 Jan 2004 08:44 GMT
> I have a JDesktopPane that contains a series of JInternalFrames. These
> frames contain various tables of data. I wish to allow the user to
[quoted text clipped - 21 lines]
>
> Unfortunately nothing appears, neither the desktop nor the results.

OK, I found what I was doing wrong about an hour after posting: I
needed a call to pack() the layout.

On to the next stage :-)

Bob


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.