Hugi
asked on
How to create own events in Java?
How I can create my own events in Java? So that I can use them with HandleEvent?
ASKER
I don't know if you did understood my question...
What I want to do is, to start an application and send an event which I can receive by another application.
What I want to do is, to start an application and send an event which I can receive by another application.
Do you mean in two separate JVM's? That would mean some sort of IPC (inter-process communication). The best thing to do would be to open a socket between the two processes and pass your events as serialized objects.
ASKER
And how can I do that?
I have found the following, but I want to communicate between two Processes on the same machine:
Socket connection = new Socket(hostname, portnum)
I have found the following, but I want to communicate between two Processes on the same machine:
Socket connection = new Socket(hostname, portnum)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you want to use JDK 1.1+ then you need to subclass java.awt.AWTEvent and call Toolkit.getEventQueue().po