1 2 3 4 5 6 7 | public class ZApplet extends JApplet{ public void init(){ this.setTitle("Man seconde applet"); } } |
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.JObject; 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"}); } }); } } |