Just return false from isOpaque().  The default for a JPanel is true, which
means every pixel is supposed to be painted, therefore the painting of the
background.  I tried this on Sun JDK 1.3, WinNT 4 SP6A, i486, and it seems
to work fine (hitting refresh after scrolling repaints the correct values).

A.J. Wilson
[EMAIL PROTECTED]

> -----Original Message-----
> From: Vella, John [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 2:47 PM
> To: Advanced Swing Mail List (E-mail)
> Subject: Anyone up for this Swing repaint challenge? (Please, I need
> your help)
> 
> 
> 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>> 
> 
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to