Help choosing layout

Hello i have a frame with 4 JPanel inside. Each JPanel has a table and each table can collapse or expand by clicking a button on table header so that only the table header is visible when collapse. I d like to, when one of the table is collapse that other table under it fill the space under the collapsed table instead of letting white space like it is right now.

I think it has to do with layout, but i cant find the right combination of layout. The JFrame has a GridBagLayout and each JPanel has a BorderLayout.

Thank you

[543 byte] By [JusteUneQuestiona] at [2007-11-27 6:42:06]
# 1
hi,i guess you need is [url= http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html]JSplitPane[/url]regardsAniruddha
Aniruddha-Herea at 2007-7-12 18:12:03 > top of Java-index,Desktop,Core GUI APIs...
# 2

Hello and thx for replying, but its not this that i want. I d like to readjust dynamically space between my tables. Right now the application looks good when all tables are expanded, spaces between tables are about 10px, but when i m collapsing for exemple the top table, then the space between the top table header (the content is hidden now) is about 80 or 100 px. Is there a way dynamically fill empty space left by my collapsed table ?

JusteUneQuestiona at 2007-7-12 18:12:03 > top of Java-index,Desktop,Core GUI APIs...
# 3

hi,

If you need further help then you need to create a

[url=http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example

Program[/url] (SSCCE) that demonstrates the incorrect behaviour.

Don't forget to use the [url=http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url]

so the posted code retains its original formatting.

Aniruddha-Herea at 2007-7-12 18:12:03 > top of Java-index,Desktop,Core GUI APIs...
# 4
See you later :)
JusteUneQuestiona at 2007-7-12 18:12:03 > top of Java-index,Desktop,Core GUI APIs...