[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


> 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 ...