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 / General / May 2005

Tip: Looking for answers? Try searching our database.

GridBagLayout on JDesktop

Thread view: 
Thomas Pototschnig - 07 May 2005 11:20 GMT
Hi,

I have problems using GridBagLayout for positioning JInternalFrames on a
JDesktop.
For instance, I have 2 JInternalFrames and I neither set the size nor the
preferedSize of the InternalFrame because I thought my JInternalFrames would
get the size from the GridBagLayout-manager but it doesn't work at all.

[...]
   desktop = new JDesktopPane();
   gbl = new GridBagLayout();
   desktop.setLayout(gbl);
   content.add(desktop);
[...]
   GridBagConstraints gbc1 = makegbc(0, 0, 1, 5);
   gbl.setConstraints(treeIFrame, gbc1);
   desktop.add(treeIFrame);

   GridBagConstraints gbc2 = makegbc(1, 0, 4, 1);
   gbl.setConstraints(tableIFrame,gbc2);
   desktop.add(tableIFrame);
[...]

the makegbc is nothing more than:
private GridBagConstraints makegbc(int x, int y, int width, int height)
{
   GridBagConstraints gbc = new GridBagConstraints();
   gbc.gridx = x;
   gbc.gridy = y;
   gbc.gridwidth = width;
   gbc.gridheight = height;
   gbc.insets = new Insets(1, 1, 1, 1);
   return gbc;
}

Can anyone give me some hints?

Thx in advance

Thomas Pototschnig
Thomas Pototschnig - 07 May 2005 12:08 GMT
I figured out that the size of my JInternalFrames is dominated by the
components inside of the InternalFrame -
is there a way to force the components inside to accept the size of the
Frame?

Thomas Pototschnig


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.