Easy layout question

S

Si

How do I have the main Container in my Frame, so that it contains two "rows"
of panels - the only difference between the two being that the top on is
about 10% of the height (or, say, 50 pixels)?

I currently have a GridLayout(2,1), but it displays both "rows" them with
equal heights...
 
B

Bjorn Abelli

...
How do I have the main Container in my Frame, so that
it contains two "rows" of panels - the only difference
between the two being that the top on is
about 10% of the height (or, say, 50 pixels)?

There are a lot of possibilities. Beside the use of the ordinary
LayoutManagers, you can even define your own.

However, 10 % or 50 pixels are two different paradigms in the underlying
assumptions on how the LayoutManagers work.

The use of exact pixel sizes was more or less abandoned for the use of
relative sizes. This is to some degree based on the premise that you would
probably prefer the look of the layout to adapt more to the actual
platform...

To make a long story short:

One suggestion could be to use a BorderLayout. Put the upper panel into the
NORTH place, and the lower one in the CENTER.

// Bjorn A
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top