Hi David
 
You might want to change your application to create a file on disk in which it stores it PID perhaps.
And when try running the app again check if this PID file exists and handle accordingly.
 
Another option is to just create a Socket on a particular port after running the application and try creatiing a socket
on same port just before running the application too.
So the second time u try running the app the check #1 would fail stating that a copy of this application
is already running.
 
The point is that only IPC available here in Java is sockets else with Semaphores we can
easily achieve this on Unix executables.
 
--Shankar
-----Original Message-----
From: David Treves [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 3:47 PM
To: JDJList
Subject: [jdjlist] re-running a running class

Hi all,
 
I have a small GUI application (SWING). When the users runs it, he gets a JFrame with a message, he may discard this window and the application is still running in the background.
 
My question is how can I set the initiation process in a way that if the application is running already it will reveal that window instead of starting a new "java" process?
 
Thanks!
David Treves.
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to