Jump to content
  • Advertisement
Sign in to follow this  
Kaze

[java] Swing Layout Managers?

This topic is 4482 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

can anyone help me with the swing layouts, Im currently working on a swing control in java, Its calendar like and consists of a class that extends a jpannle that contains other panels to hold title information, a calendar grid and a control at the bottom, Im having trouble formatting it, it needs to be able to resize, I want something like a grid layout except I want the top and bottom to only take about 10% each instead 33% each, I tried the spring layout but it keeps compressing the components it hold to their minimum size while I want them to take up as much room as they can.

Share this post


Link to post
Share on other sites
Advertisement
hopefully i can post a screen shot latter

basicy i want

-------------
| top |
-------------
| |
| grid |
| |
-------------
| bottom |
-------------

insted of

-------------
| top |
| |
-------------
| grid |
| |
-------------
| bottom |
| |
-------------

im trying absolute layout but it seems getHeight returns zero until after the componet is added so i cant format it in use the constructor
EDIT: pretened there are spaces to make the edges line up

Share this post


Link to post
Share on other sites
Do you use:

Main panel (BorderLayout)
--------------------------------------
| Top (JPanel (FlowLayout?)) |
|------------------------------------|
| |
| |
| |
| |
| Middle (JPanel(GridLayout)) |
| |
| |
| |
| |
| |
| |
|------------------------------------|
| Bottom (JPanel (FlowLayout?)) |
--------------------------------------


Do you have 1 main panel with three panels in it: one North, one South and one Center?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!