Sign in to follow this  
Kaze

[java] Swing Layout Managers?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this