Bonjour à tous !!

Je suis actuellement en train de travailler sur un projet qui analyse une petite base de donnée mysql.

Le principe : à partir de cette base, j'analyse les données et j'affiche avec une superposition de plusieurs images qui représentent des bouton verts (etat en fonctionnement) ou rouge (etat hors service).

A l'état initial , je met tout mes bouton au vert :

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
public void paintComponent(Graphics g) {
		super.paintComponent(g);
 
 
		g.drawImage(train, 0, 0, this);
		g.drawImage(bouton_vert, 100, 50, this);
		g.drawImage(bouton_vert, 230, 50,this);
		g.drawImage(bouton_vert, 300, 50,this);
		g.drawImage(bouton_vert, 450, 50,this);
		g.drawImage(bouton_vert, 520, 50,this);
		g.drawImage(bouton_vert, 670, 50,this);
		g.drawImage(bouton_vert, 745, 50,this);
		g.drawImage(bouton_vert, 60, 70,this);
		g.drawImage(bouton_vert, 925, 70,this);
		g.drawImage(bouton_vert, 880, 50,this);
 
 
		g.setColor(Color.red);
        g.fillRect(ZONE_IMAGE_1.x, ZONE_IMAGE_1.y, ZONE_IMAGE_1.width, ZONE_IMAGE_1.height);
 
        g.setColor(Color.blue);
        g.fillRect(ZONE_IMAGE_2.x, ZONE_IMAGE_2.y, ZONE_IMAGE_2.width, ZONE_IMAGE_2.height);
        g.drawRect(ZONE_IMAGE_401.x, ZONE_IMAGE_401.y, ZONE_IMAGE_401.width, ZONE_IMAGE_401.height);
        g.drawRect(ZONE_IMAGE_404.x, ZONE_IMAGE_404.y, ZONE_IMAGE_404.width, ZONE_IMAGE_404.height);
        g.drawRect(ZONE_IMAGE_406.x, ZONE_IMAGE_406.y, ZONE_IMAGE_406.width, ZONE_IMAGE_406.height);
        g.drawRect(ZONE_IMAGE_409.x, ZONE_IMAGE_409.y, ZONE_IMAGE_409.width, ZONE_IMAGE_409.height);
        g.drawRect(ZONE_IMAGE_411.x, ZONE_IMAGE_411.y, ZONE_IMAGE_411.width, ZONE_IMAGE_411.height);
        g.drawRect(ZONE_IMAGE_413.x, ZONE_IMAGE_413.y, ZONE_IMAGE_413.width, ZONE_IMAGE_413.height);
        g.drawRect(ZONE_IMAGE_415.x, ZONE_IMAGE_415.y, ZONE_IMAGE_415.width, ZONE_IMAGE_415.height);
        g.drawRect(ZONE_IMAGE_432.x, ZONE_IMAGE_432.y, ZONE_IMAGE_432.width, ZONE_IMAGE_432.height);
        g.drawRect(ZONE_IMAGE_433.x, ZONE_IMAGE_433.y, ZONE_IMAGE_433.width, ZONE_IMAGE_433.height);
        g.drawRect(ZONE_IMAGE_434.x, ZONE_IMAGE_434.y, ZONE_IMAGE_434.width, ZONE_IMAGE_434.height);
        g.drawRect(ZONE_IMAGE_435.x, ZONE_IMAGE_435.y, ZONE_IMAGE_435.width, ZONE_IMAGE_435.height);
        g.drawRect(ZONE_IMAGE_436.x, ZONE_IMAGE_436.y, ZONE_IMAGE_436.width, ZONE_IMAGE_436.height);
 
		// getWidth()     getHeight()
	}

Et ensuite je commençe à analyser ma bases pour détecter les différent état grace a une requete de type SELECT.

Ensuite , je réalise donc des conditions if else if en fonction du contenu de ma requete , et je susi censé afficher le nouvel état en mettant a jour mes superpositions de départ.

Mon problème :

Je n'arrive pas à réaliser cette mise à jour, mon affichage de départ ne se redessine à aucun moment , j'ai beau essayer ça ne fonctionne pas.

Pourtant , j'ai fait un affichage console , et mon programme rentre bien dans ma condition (condition vérifié).