Java Threads mailing list archive

Re: Java Tip 68: Learn how to implement the Command pattern in

From: P.H.Welch@ukc.ac.uk
Date: Fri, 12 Feb 1999 15:48:49 GMT


Oyvind:

> Don't you always have to "getGraphics()" or copy it from an
> existing Graphics with "create()"? Does that imply that you can't
> send it over a channel, perhaps? Or regenerate it at the other
> side?  =

I started trying to use "getGraphics()" once upon a time ... but
funny things would happen.  I think I understand better now, and
that's never to hold on to a Graphics object - always use the
new one freshly delivered by the paint/update callback from the
Event dispatching (horrible name) thread.

Sending this freshly delivered Graphics object over a channel is
no problem.  It's just that using it in the receiving process (thread)
also gives funny behaviour - even though I block the Event thread
by making it wait for an acknowledge from the receiving process.
Funny - it's as though some system code complains if the thread
executing those Graphics methods isn't the Event one ...

Peter.

	


Last updated: Tue Nov 2 12:11:31 1999
Maintained by Peter Welch.