I have a signed applet. It has couple links to the documents on user's local machine. When user clicks on a link, it creates a new thread and uses DOS "start" command to open the document. The run method of the thread is something like this:
public void run()
//Now call up the application to view doc
//Get Windows information
//This is NT command
Runtime.getRuntime().exec("cmd /C \"start /wait
System.out.println("Finishing editing - "+defdir);
catch (Exception e)
When I opened the first document, it was fine. The document did stay on the screen. When I opened the 2nd document while the 1st one was still up, it did launch the 2nd document in WORD BUT the 2nd thread immediately executes ==> System.out.println("Finishing editing - "+defdir); without waiting the close down of the 2nd document. How come?
Is it because each applet has only one runtime env and it can only execute one dos command at a time? Is there any work around? Or any alternative?
My goal is to launch multiple applications(associated with the files) on the local machine to edit the documents. Once the user finishes editing a doc, the applet determines if the document has been modified. If so, it saves it back to the server.