How can I make user only run one instance of my GUI application?
The easiest way is to use RMI to start the app and check to see if it's already running.
The basic structure is this:
- The main method of your app checks the RMI registry to see if the app is started. If so, exit.
- Otherwise, the main creates an instance of the app (which is a remote object) and registers it in the RMI registry.
- The class' constructor creates the GUI and displays it. Alternatively, you could create a "start" method that you call via RMI to start the app.