I have an application that is a third party application that has a Swing GUI. Now I want to create a background application that will be captured user click events of the third-party application, later will use captured events for replay.
Asked
Active
Viewed 95 times
0
-
1*"I have an application that is a third party application that has a Swing GUI."* Given it's another Java app., it should be possible to launch that app from your own, then gain a reference to the main window and plumb down through its children to get access to components (buttons, menus etc.) of interest. Otherwise it would likely require native code. – Andrew Thompson Jan 05 '21 at 05:57
-
@AndrewThompson Yes it's another application that is already running. – intu Jan 05 '21 at 06:03
-
2There are already tools that record user actions in _Swing_. Do you want to reinvent the wheel? Use Google to search for ___java swing record and replay___ – Abra Jan 05 '21 at 06:11
-
I would agree with @Abra dont re invent the wheel if not needed. However here is an answer showing how to detect mouse events in a 3rd party swing gui https://stackoverflow.com/a/65378026/1133011 as AndrewThompson mentioned it does use native code but the library does the heavy lifting for you – David Kroukamp Jan 05 '21 at 07:47