I am not sure if this is a Windows or Java issue.
I have a Java application running under Windows. I have associated a specific file extension (say .xyz) with my application, so when I double-click the .xyz file, my Java application starts up and the main () method sees the .xyz file as its first argument.
But when I click on another .xyz file, a new instance of the Java application is launched. I would prefer the existing application to process the new file.
Is there a standard way to do this, or do I need to program it from scratch?
If this is the case, I assume that I need to do something like this: When the second instance of the application starts, it checks if another instance is running (how?), Opens a link for the first instance, and passes the file name. Right?
source share