Thank you all for your help!  :o)
 
David.
 
----- Original Message -----
To: JDJList
Sent: Thursday, May 30, 2002 11:54 AM
Subject: [jdjlist] RE: re-running a running class

no madhav that is quite simple. Do the show of the window after making sure the
port of concern is open.
 
That is if the port is open then its as good as the application is running in this case
else just show this after running the application.
right????
 
The window part is just a programming issue and is not too involved.
 
--Shankar
 
 
-----Original Message-----
From: Madhav Vodnala [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 3:20 PM
To: JDJList
Subject: [jdjlist] RE: re-running a running class

Right.
 
There are multiple ways to detect whether an instance of an application is already running. Be it creating
a local file and storing some infor or creating a server socket etc etc .
 
But the actual question is how to bring the already running application to the front?
I dont think there is a direct way in java to do this. We might have to get into OS specific
impl to acheieve this.
 
 
-Madhav
 
----- Original Message -----
To: JDJList
Sent: Thursday, May 30, 2002 2:59 PM
Subject: [jdjlist] RE: re-running a running class

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
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
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to