Disable perpetual repaint during resizing of JFrame?
Posted on 2004-08-07
Ugly perpetual repaint as I re-size a JFrame. This is CPU-intensive, and
would probably make Swing look really ugly on slower systems.
When re-sizing, the user should see only an outline of the extending edge(s),
and the frame would snap and re-paint only when the edge is dropped.
( I'm not entirely clear as to what constitutes a resize, but from the looks of it,
I wouldn't be surprised if a resize event occurs for every pixel moved.)
I have seen an incomplete and sparse example (i.e. non-working solution)
elsewhere in EE, which uses addComponentListener to override the
componentResized, but I fear that would do the same thing, since it re-paints
every time the frame is "re-sized." A also tried adding a component listener,
with an empty function for componentResized, but observed no change in behavior.
- Is this more complex than it seems?
(Perhaps inhibit re-paint until the edge of the component is dropped?)
- Or is there a magic attribute that would fix this instantly?