forcing JPanel to fill entire BorderLayout region
843805Feb 24 2006 — edited Feb 24 2006I've built a JPanel which contains a couple of widgets, and now I'd like to add it to a JFrame that uses a BorderLayout as its layout manager. I'm adding the panel to the north region of the frame, and would like the panel to expand to fill up the entire region. Currently the panel gets centered in the region and I can't figure out how to make it grow horizontally to fill up the whole thing. I'd prefer not to call setSize() on the panel, since that won't work if the user resizes the JFrame (right?).
What do I have to do in order to have the panel behave as I want? The panel itself, the layout manager, or something else?
thanks for any help.
- Dan