j'ai le code de mon Applet
le code de ma page jsp
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
26
27
28
29
30
31
32
33
34
35
36
37
38 package test; import java.io.*; import java.awt.*; import java.util.*; import java.applet.*; import java.awt.event.*; public class k extends Applet { Button move; Random r; public void init() { setLayout(null); move = new Button("Click me"); add(move); move.reshape(10,10,70,30); r = new Random(); setBackground(Color.red); setForeground(Color.yellow); } public void paint(Graphics g){ g.drawString("Welcome JSP-Applet",100,100); } public boolean action(Event evt, Object whatAction) { if (!(evt.target instanceof Button)) return false; String buttonLabel = (String)whatAction; if (buttonLabel == "Click me") { move.reshape(Math.abs(r.nextInt())%(size().width-70), Math.abs(r.nextInt())%(size().height-30),70,30); repaint(); } return true; } }
mais l'erreur est qu'il m'affiche un carré avec une info bulle: cliquer pour obtenir plus d'informations
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
26
27
28
29
30 <%@ page language="java" contentType="text/html; charset=windows-1256" pageEncoding="windows-1256"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://displaytag.sf.net" prefix="display" %> <%@page import="test.TestData"%> <%@page import="java.util.Locale"%><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> <link rel="stylesheet" href="displayTheme.css" type="text/css" /> <title>list 1</title> </head> <body> <jsp:plugin type="applet" code="k.class" codebase="applets" jreversion="1.1" width="200" height="200" > <jsp:params> <jsp:param name="couleur" value="eeeeee" /> </jsp:params> </jsp:plugin> </body> </html>
Merci
Partager