Implement java.awt.event.WindowListener. There are two methods in there that will be alerted when a window opens or closes. Then call addWindowListener() on your Frame object and pass the WindowListener object as an argument.
The two methods are:
public void windowOpened(WindowEvent e);
public void windowClosing(WindowEvent e);
Message was edited by:
Lord_Jirachi
> Hello,
>
> I want to know if there is any way that i can know in
> java when a windows application is launched and when
> it is closed.
>
> Thanks in Advance
>
> Juan Sebasti醤 Escobar C.
If you are launching the application from java using a Process object then all you need to do is listen on that process. I did have some code once upon a time that did just that - but unfortunatly I lost it.