Bonjour,
je suis entrain de developpez une applet java qui permet de dessiner le trafic sur le reseaux en temp reel
l'applet je l'ai crée et elle marche correctement mais il y a un ptit probleme
c'est que lorsque je bouje l'applet avec la souris ou bien lorsqu'une autre fenetre vient au dessus de l'applet celle si s'efface et devient incompréhensible. je ne sais pas c koi le problemme
voici mon applet :

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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package testjsp;
 
import java.awt.Color;
import java.awt.Graphics;
import java.io.IOException;
 
import javax.swing.JApplet;
 
public class TracerTraficTempRéel extends JApplet implements Runnable {
 
	int i = 0;
	int x1 = 0, x2 = 0, y1 = 0, y2 = 0, y0 = 0;
	int point_T1 = 0, point_T2 = 0;
	int result = 0;
	Thread th = null;
	boolean threadSuspended;
	static final int[] Tab_OID_IfinOctet = new int[] { 1, 3, 6, 1, 2, 1, 2, 2,
			1, 10, 5 };
	static EnvoieRequete Envoyer_Requete_Inoctet = new EnvoieRequete(
			"udp:127.0.0.1/161", "public", Tab_OID_IfinOctet); // @jve:decl-index=0:
 
	public void init() {
		setBackground(Color.BLACK);
		setSize(700, 200);
		setLocation(0, 100);
		System.out.println("Init()");
	}
 
	public void start() {
		if (th == null) {
			System.out.println("start(): creating thread");
			th = new Thread(this);
			System.out.println("start(): starting thread");
			threadSuspended = false;
			th.start();
		} else {
			if (threadSuspended) {
				threadSuspended = false;
				System.out.println("start(): notifying thread");
				synchronized (this) {
					notify();
				}
			}
		}
 
	}
 
	public void run() {
		point_T2 = 0;
		System.out.println("run()");
		try {
			y0 = Envoyer_Requete_Inoctet.SendRequest("udp:127.0.0.1/161",
					"public", Tab_OID_IfinOctet);
		} catch (IOException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		try {
			th.sleep(10000);
		} catch (InterruptedException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		while (true) {
			System.out.println(i);
			try {
				y1 = Envoyer_Requete_Inoctet.SendRequest("udp:127.0.0.1/161",
						"public", Tab_OID_IfinOctet);
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			System.out.println(" y1  " + y1);
			x1 = x2;
 
			System.out.println("Somme = " + (((y1 - y0) / 5) * 0.0009765625));
			x2 = i + 10;
			point_T2 = (int) (((y1 - y0) / (x2 - x1)) * 0.0009765625);
			showStatus("i is " + i);
			repaint();
			try {
				th.sleep(10000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			y0 = y1;
			i = i + 10;
 
		}
	}
 
	public void paint(Graphics g) {
		System.out.println("paint()");
		g.setColor(Color.green);
		g.drawLine(0, 200, 700, 200);
		g.drawLine(x1, 200 - point_T1, x2, 200 - point_T2);
		System.out.println(point_T1 + "    " + point_T2);
		point_T1 = point_T2;
	}
 
}
sachant que les valeurs obtenue (y0,y1,y2) sont des valeur de type COUNTER .
j'ai fé le calcul et tous .
merci de m'aidez