Another Java question:

NTB

Diamond Member
Mar 26, 2001
5,179
0
0
Been working on a java program for a while today, and ran into a small problem: I realized that the window, as I originally dimensioned it, was not wide enough to fit everything that I needed. No problem...I'll just expand it a bit, right? Well, the *window* expanded, but the set of panels I was using to organize everything didn't expand with it. And it seems that no matter what I do, they won't. Playing with the min/max/preffered sizes seems to make no difference (using JBuilder 8 to write the program). Any suggestions? Any help will be appreciated :)

Nate
 

NTB

Diamond Member
Mar 26, 2001
5,179
0
0
Originally posted by: Kilrsat
What layout manager are you using?

for the JApplet over all? Border layout - I wanted to split the window into top / middle / bottom sections. So I've got 1 panel in the north section, 1 in the center section, and 1 in the south section. Nothing for East and West.

Nate
 

Kilrsat

Golden Member
Jul 16, 2001
1,072
0
0
Originally posted by: NTB
Originally posted by: Kilrsat
What layout manager are you using?

for the JApplet over all? Border layout - I wanted to split the window into top / middle / bottom sections. So I've got 1 panel in the north section, 1 in the center section, and 1 in the south section. Nothing for East and West.

Nate


The borderlayout will query each panel in each section for how much room it needs. The panel says how much it needs by querying its layout manager/contents. By default North/South only expand their width as the window size increases, getting their height from the height necessary to display the components in those areas.

So what layouts are you using for all your internal panels?

Basically you just have to walk down the tree to find why something isn't reporting the correct size.

Here's a basic BorderLayout example, along with a BorderLayout demo to show you how resizing is supposed to work.
http://java.sun.com/docs/books...ing/layout/border.html
 

NTB

Diamond Member
Mar 26, 2001
5,179
0
0
got it figured out - thanks for the help. I'll probably be back with more questions before this project is done :)

Nate