Hi,
I am trying to open a url by clicking over the link of JLabel in Windows 7 (32 -bit) but unable to do so. After clicking on the link, it doesn't do anything. Although, it is opening the file successfully.It used to work in XP.
The code is as follows:
String osname = System.getProperties().getProperty("os.name").toUpperCase();
if (osname.startsWith("WINDOWS")){
Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL \"" + path + "\"");
}
else{
String[] commands = {"start", "\"\"", path};
Runtime.getRuntime().exec(commands);
}
I would appreciate your help.