Capturing Events?
Peter C. Mehlitz
kaffe@rufus.w3.org
Fri, 7 Aug 1998 20:20:22 +0200
On Fri, 07 Aug 1998, Harish Sankaran wrote:
>I want to modify the virtual machine a bit so as to accept events
>(generated by an applet running on other machine) through
>a socket connection.Could anyone out there tell me as to
>where and what should I modify in the VM?
You don't have to modify the VM, just the AWT classes are involved. I think
there are two solutions:
(1) create a new thread, listening on the socket and re-posting any incoming
(external) events via EventQueue.postEvent() (i.e. dispatch via the localQueue)
(2) modify EventQueue.getNextEvent() so that it not just checks for localQueue
or native Events, but also for external events (via your socket)
I guess the first way is the better one, because it does not slow down
processing of native events and leaves the AWT classes unchanged.
-- Peter