Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Moving and resizing a JFrame without painting twice

807606Mar 23 2007 — edited Mar 23 2007
I'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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2007
Added on Mar 23 2007
7 comments
333 views