setRepaint(false) kills component resizing

I’m using a Canvas with double-buffering for 2D animation. Since I’m painting to it from outside of the AWT thread, I have repaints disabled. However, this also kills updates to the component size when the window is resized.

I’ve been filling the area bounded by getWidth() and getHeight(), but when the window is resized to a larger size, this leaves strips of garbage around the edge of the Canvas. Could I just blank out an area the width and height of the screen on each repaint, or will that break on some systems when I paint beyond the edge of the Canvas?

Also, the system I’m using is a Canvas with JScrollBars (so I can use the SkinLF on the scrollbars) arranged to the right and bottom using a BorderLayout, all inside a JFrame. (I’ll eventually fix this with a real scroll pane layout.)

This works fine as long as the JFrame doesn’t use decorated borders. When I use decorated borders, the Canvas initially extends over the JScrollBars, even over the decorated border. After the JFrame is resized, the JScrollBars reappear.

Resizing the window to a larger size works, but the width can’t be resized to a smaller size. You can click and drag the edge in all you want, but it just sits there.

Any advice (especially with the garbage in the margins of the Canvas) would be greatly appreciated.

Thanks!