[1770] in java-interest
Re: Repaint : how doest it work ? Interaction with XOR mode.
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Sat Sep 16 21:09:05 1995
Date: Fri, 15 Sep 1995 10:50:09 -0800 (PDT)
From: Arthur van Hoff <Arthur.Vanhoff@Eng.Sun.COM>
Reply-To: Arthur van Hoff <Arthur.Vanhoff@Eng.Sun.COM>
To: dufourd@enst.enst.fr
Cc: java-interest@java.Eng.Sun.COM
Hi Jean-Claude,
> >> There is a possibility of drawing outside of paint and update methods
> >> by using Component.getGraphics(), which should be used for rubberband
> >> like interaction.
> >
> >It is possible to use that. We recommend that you use repaint though.
> >Grabbing a graphics context like that amy interact badly in case
> >the window in which the applet is embedded is being scrolled.
>
> Thank you for the info.
> I grab a graphics context ONLY in mouseDrag(), or in general while
> the mouse is down. I guess I am pretty safe from spurious scrolling
> then, unless the user has two mice ;-)
In a multi-threaded environment you don't need two mice! The window could
be auto-scrolling, or the document could still be being loaded while you
are interacting with the applet. Anyway, I think you are right, in the
mouseDrag case it is unlikely to cause problems, but to be sure you should use
repain().
Have fun,
Arthur van Hoff
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com