I have a window that can expand or collapse with the push of a button. The button handler calls setSize() and I have defined resize() and paint() functions to reposition and draw components. The problem is that when I click the button, I see a blank window of the new size drawn, and then there is a significant delay (~1 second) before the components are drawn on the window. Is this normal? Is there anything to be done about it?