jQuery
En savoir plus
Développement Android
En savoir plus
Adobe Flex & Flash
En savoir plus

Quelle est la différence entre un applet et une servlet ?
3 546 participants
Code : Java
1 2 3 4 5 6 7 | public class ZApplet extends JApplet{ public void init(){ this.setTitle("Man seconde applet"); } } |
3 467 participants
Grâce à quelle instruction Javascript peut communiquer avec une applet ?
3 350 participants
Ici, on part du principe que l'applet en question est sur une page web avec toutes les ressources nécessaires ! La méthode Javascript existe.
Code : Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import javax.swing.JButton; import netscape.javascript.JSObject; import java.awt.event.ActionListener; public class ZApplet extends JApplet { private JButton bouton; private JSObject jso; public void init(){ jso = JSObject.getWindow(this); bouton = new JButton("Cliquez sur moi !"); bouton.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event){ jso.call("AfficheMoi", new String[]{"Message à afficher"}); } }); } } |
3 370 participants
