ouvrir une page web + interface
Bonjour,
je veux à travers un bouton pouvoir lancer une page web :
voici le code que le bouton exécute:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Properties sys = System.getProperties();
String os = sys.getProperty("os.name");
Runtime r = Runtime.getRuntime();
try{
if (os.startsWith("fedora"))
r.exec("mozilla www.google.fr");
else if (os.endsWith("NT")||os.endsWith("2000")||os.endsWith("XP"))
r.exec("cmd /c start www.google.fr");
else
r.exec("mozilla http://localhost/nagios/");
}catch (IOException eo) {
System.err.println(eo.getMessage());
} |
mais j'ai le message d'erreur suivant :
Citation:
java.io.IOException: mozilla: not found
j'ai enlevé mozilla et ça ne fonctionne pas non plus.
merci de votre aide.
Ps: j'ai fedora6.