I am trying to write a small internal tool to use for debugging focus tasks in Swing applications. Right now, the debugger tool is built into the application and enabled using the debug command line argument.
I would like for me to have a separate standalone Java application that can connect to another JVM and listen for certain events (in this case PropertyChangeEvents on KeyboardFocusManager).
Ideally, it should be able to do this without any changes to the debugged application, so it can be used βon demandβ to debug focus problems in any Swing application. It looks like VisualVM can connect to any running virtual machine.
Is it possible? What are some starting points? Jmx? Any other IPC mechanism?
source share