I have a button to view an image attached to a log entry and when the user clicks that button I want it to open the image in the user\'s default image viewer on a Windows ma
Another solution that works well on Windows XP/Vista/7 and can open any type of file (url, doc, xml, image, etc.)
Process p;
try {
String command = "rundll32 url.dll,FileProtocolHandler \""+ new File(filename).getAbsolutePath() +"\"";
p = Runtime.getRuntime().exec(command);
p.waitFor();
} catch (IOException e) {
// TODO Auto-generated catch block
} catch (InterruptedException e) {
// TODO Auto-generated catch block
}