1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| public void actionPerformed(ActionEvent e) {
System.out.println("test num = "+ e.getActionCommand().substring(9, valide.getLabel().length()));
if ( BaseDeDonnee.adversaire(Integer.parseInt(e.getActionCommand().substring(9, valide.getLabel().length())),getParameter("user")) == 1)
{
try {
URL url = new URL(getDocumentBase(), "http://localhost:8080/jeu_dames/index.html");
url.openStream();
AppletContext ac = getAppletContext();
ac.showDocument(url, "_blank");
System.out.println("bouton pressé "+ ac);
//System.out.println("bouton pressé");
//Desktop.browse(url);
}
catch (MalformedURLException e1) {
System.out.println("erreur "+ e1); }
// } catch (DesktopException e2) {
// System.out.println("erreur "+ e2);
// }
catch (IOException e3) {
e3.printStackTrace();
System.out.println("erreur "+ e3);
}
}
} |
Partager