Moving and resizing a JFrame without painting twice
807606Mar 23 2007 — edited Mar 23 2007I'm working on a JFrame that has hideable 'drawers' on each side of a central panel. The goal is to have hiding or revealing a 'drawer' panel not adjust the position of the central panel (as though you were opening a drawer). I've got the functionality down; I'm encountering an irritating graphical issue, however. To accomplish the 'central panel stays in the same position' functionality when hiding/revealing a panel on the left or top, I actually have to move the Frame, and resize it to account for the new dimensions. The problem is, doing it this way, Swing repaints the frame twice: once when I resize it, and again when I move it. This creates a distracting flicker that I'd like to avoid.
Is there some way to accomplish both the location change and resize of the frame without repainting in between? Or is there another solution for this that I'm overlooking?