Originally posted by Joe Vahabzadeh:
The layout I want to use is really somewhat like BorderLayout in terms of arrangement, and the JComponent will go in the center. HOWEVER, instead of the standard BorderLayout behavior in terms of sizing, filling empty space, etc, the behavior I want is:
CENTER - strictly respects the horizontal and vertical sizes of the JComponent and DOES NOT increase its size in either direction. Always keep it centered in the container.
PAGE_START and PAGE_END - 100% width horizontally. Vertically expands to take up any extra space not taken by CENTER
LINE_START and LINE_END - vertically expands to match CENTER height, and horizontally expands to take up any extra space not used by CENTER.
I figure I can do this with GridBagLayout, but getting the constraints set so I get the behavior I want is driving me nuts!
Originally posted by Joe Vahabzadeh:
However, if there's NOT enough room for it (ie: the container, in this case a JInternalFrame, is resized smaller than the preferred size of the CENTER component), the component in the CENTER section gets shrunk down to a tiny square (I guess 2 pixels by 2 pixels or so, if I had to estimate).
Originally posted by Joe Vahabzadeh:
Ah, the CENTER should always be it's preferred size, under ALL circumstances.
That said, I figured out that what I did wrong had nothing to do with the layout, etc.