August 2004
Intermediate to advanced
480 pages
9h 41m
English
There are many times that you might like to launch an application that is running on the user's machine. For example, an external Web browser could be used to display help pages. There is a way to do this that is as easy as running it yourself from the command line. All you have to know is its name on the system. To make your Java application open Windows Explorer, write
try {
Runtime.getRuntime().exec("explorer");
} catch(IOException ioe){
System.out.println(ioe.getMessage());
}
You have to catch or rethrow the IOException that this call can occasion. Note that we just pass in the system name, not including the file extension.
Not only can we start an external ...
Read now
Unlock full access