Hi Rob,
repaint() does the right thing - it queues up a request to call paint on the
component on the right thread at some later time. This means, of
course, that
repaint() is an asynchronous request; it will return to the caller as
soon as the
request has been posted, and not necessarily after the paint has
actually occurred.
In any case, feel free to use repaint() from whatever thread you want;
that's what
it's there for...
Chet.
Rob Ross wrote:
This is semi-swing related, but since there's not a swing-interest list and since it's
also semi 2D related, I thought I'd try here.
I learned this past JavaOne that every swing app I have ever written has been broken,
as I often do
public static void main(String[] args)
{
JFrame f = new JFrame();
f.setVisible(true);
}
when in fact I should be calling this from the event handling thread via a
SwingUtilities.invokeLater() call.
My question is, can I call repaint() on a component from another thread, or does that
also have to be called from within the event thread? Doesn't repaint just queue a
request for later processing anyway? If so, why would I need to spawn a separate
thread just to call the repaint?
Rob
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".