Hello developers!
I have a Java program that uses reflection to find and invoke the main(String[] args) method of another Java program. This other program is usually a Swing App that tends to spawn its own threads. I was wondering if there was a way to determine when this other 'program' terminates. I'm not sure if there is anyway to detect this since it executes in the same space as the host program. The current method is just to check if any of the frames open aren't our own, not exactly the greatest solution. Running the child program in its process also isn't really an option since we access to it.
EDIT: It looks the answer is a dual approach. First create a ThreadGroup and launch the child program in a thread that is a member of that group. Then make sure to check Frame.getFrames() if any of the frames belong to child.
Thank you, --Sandro