Swing, SpringLayout, and JPanel hiding trick

Hi All,

I got a problem with my application for refreshing the UI. I use JPanel and SpringLayout to layout my UI, because of the nested layout I got confused how to re-update the UI after I hide some of the panel that I have on screen.

Basically I have 7 panels displayed on the screen (A to G)

A (JFrame)

|

|- B (JScrollPane)

|

|-C (JPanel, [i]using SpringLayout[/i])

|

|- D (JPanel [i]with action listener to hide/show E[/i])

|

|- E (JPanel)

|-- F (JPanel, [i]with action listener to hide G[/i])

|-- G (JPanel

When I try to hide/show panel E by clicking on D, my codes can refresh panel C, but somehow when I try to click on panel F to display/show panel G, my codes can't refresh panel C. this problem affects the size of the scrollpane that I have in panel B.

Well.. it's kinda confusing specially I tried to revalidate and repaint all the components C above and none of them works. any help are appreciated.

[1019 byte] By [ot6a] at [2007-10-3 9:40:25]
# 1
We may need to see some code.Post a small demo code that is generally compilable, runnable and could reproduce your problem. See: http://homepage1.nifty.com/algafield/sscce.html and http://www.yoda.arachsys.com/java/newsgroups.html
hiwaa at 2007-7-15 4:56:24 > top of Java-index,Desktop,Core GUI APIs...