tags:

views:

52

answers:

1

Hi I have created a java swing application. If I run that application then it runs properly (a frame is created) and it is associated with a process id. when that application is running I want to see the that frame using process ID

Thanks Sunil Kumar Sahoo

A: 

Run

 String pid = new BufferedReader(new InputStreamReader(
                  Runtime.getRuntime().exec("perl -e 'print getppid()'").getInputStream()
              )).readLine();;

That will return the PID of the java process, but only if perl is installed

Lee