I have a repaint problem that involves needing to manage the repaint of one
component entirely from the repaint code of another component. For
architectural reasons of my app, I have the following layout
configuration(both components are just extended JPanels):
______________________________
[ Comp A | Comp B ]
[__________|___________________]
In the figure above, Comp B draws various text strings, some of which need
to straddle the boundary between Comp A and itself. This means Comp B has to
draw "outside" of itself. I can't seem to figure out how to prevent Swing's
RepaintManager from clearing the background of Comp A(even after setting
Comp A to being opaque).
I've attached a simple test app that shows this problem. The goal is to
modify the code to allow the text strings that are drawn outside of the
middle component to be updated while you drag the scrollbar.
IS ANYONE UP TO THIS CHALLENGE?
Thanks,
John
<<foo.java>>
foo.java