I recently put together an application that relied heavily on the Desktop.open( ) method and several other methods from the Desktop class. However, all of a sudden the Desktop.open() does not work. I believe I read some where that this was due to the ShellExecute function or dll or something like that.
However, since my app is targetted at the Windows platform I resorted to using windows Explorer to launch the system default applications for files using a the code below
public static void openFile(File file) {
try {
Runtime runtime = Runtime.getRuntime();
runtime.exec( "explorer.exe \"" + file.getAbsolutePath() + "\"" );
} catch(IOException) {
ioe.printStackTrace();
JOptionPane.showMessageDialog(null, "Could Not Open File Location: " + file.getAbsolutePath());
}
}
The code works as expected, but my problem is that I am loosing cross-platform functionality.
Can any point my to solution to this Desktop.open( ) problem, or probably add the my list platform dependent launch procedures so at least the code works on Windows,Linux and Mac.
ICE