1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| // si le bouton lancer est appuyé
if(evt.getSource()==bLancer)
{
// si aucun élément de la liste n'est sélectionné, on arrête
if(nliste.size()==0 || jliste.getSelectedIndex()==-1)
return;
// Sinon, on récupère le profil correspondant
Profil pr = (Profil)liste.get(jliste.getSelectedIndex());
String commande[] = new String[]{
"wine",
pr.getPath(),
" -"+pr.getArg()
};
System.out.println(commande);
try{
Process proc = Runtime.getRuntime().exec(commande);
}catch(IOException e)
{
System.out.println("Erreur de commande");
}
} |
Partager