Using SwingEventMonitor to monitor other applications?

How to use SwingEventMonitor to track mouse events in applications running in other JVMs?

The demo code that I have allows me to track mouse clicks in applications running in its own JVM, but the applications run separately or are ignored through jnlp.

How can I make sure Java loads my SwingEventMonitor application with every application, no matter how it was launched (desktop or jnlp)

+6
source share
1 answer

Start the monitor and create sever = ServerSocket(MONITOR_PORT) . Then listen for incoming connections:

 while (true) { Socket socket = server.accept(); connectionCount++; // start a new monitor thread for this connection } 

Note. SwingEventMonitor is no longer included in JDK1.7, you can click your own EventQueue. See What Happened to SwingEventMonitor?

+1
source

Source: https://habr.com/ru/post/901331/


All Articles