I have a series of components underneath each other in a JPanel set as a GridLayout.
I need to temporarily hide the components but setVisible(false) doesn\'t cu
I really don't like the GridLayout. Instead of writing your own layout manager, I would suggest you take a look at the TableLayout. I use it all the time.
The initial learning curve is a bit steeper than the GridLayout, but it is easy to get it to behave the way you want.
http://java.sun.com/products/jfc/tsc/articles/tablelayout/