JAVA_lancer une application windows

Fermé
john_matrix Messages postés 443 Date d'inscription dimanche 4 septembre 2005 Statut Membre Dernière intervention 19 avril 2008 - 17 avril 2006 à 16:35
choubaka Messages postés 39420 Date d'inscription jeudi 4 avril 2002 Statut Modérateur Dernière intervention 19 février 2025 - 18 avril 2006 à 07:45
bonjour
comment lancer une application a partir d'un programma java c'est a dire comment ouvrir word par exemple dans un programm?
A voir également:

1 réponse

choubaka Messages postés 39420 Date d'inscription jeudi 4 avril 2002 Statut Modérateur Dernière intervention 19 février 2025 2 104
18 avril 2006 à 07:45
salut

la commande pour lancer un programme extèrieure à java est

Runtime r = Runtime.getRuntime();
r.exec(String command);


command pouvant être par exemple "C:/Microsoft Office/word.exe"



il existe plusieurs méthodes "exec()" avec différents arguments, à voir dans la javadoc

http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html#getRuntime()
0