Bonsoir à tous !!

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

Le principe est, à partir de cette base, j'analyse les données et j'affiche des images et je réalise une superposition d'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é).

Je poste ma classe afin de mieux me faire comprendre :

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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableColumn;


class IHMImages extends JPanel implements MouseListener  {
	
	
	private static String s;
	private static String b;
	
	private static final long serialVersionUID = 1L;
	
	// position de la première zone de limage que l'on veut (ici elle se trouve au pixel x=0, y=0 et s'étend sur width=10 et height=10)
    private static final Rectangle    ZONE_IMAGE_1 = new Rectangle(291, 300, 38, 15);
    // position de la première zone de limage que l'on veut (ici elle se trouve au pixel x=100, y=100 et s'étend sur width=30 et height=20)
    private static final Rectangle    ZONE_IMAGE_2 = new Rectangle(180, 300, 35, 15);
	private static final Rectangle    ZONE_IMAGE_401 = new Rectangle(113, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_404 = new Rectangle(179, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_406 = new Rectangle(245, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_409 = new Rectangle(311, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_411 = new Rectangle(377, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_413 = new Rectangle(443, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_415 = new Rectangle(509, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_432 = new Rectangle(575, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_433 = new Rectangle(641, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_434 = new Rectangle(707, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_435 = new Rectangle(773, 127, 47, 35);
    private static final Rectangle    ZONE_IMAGE_436 = new Rectangle(853, 127, 47, 35);

	Image train, bouton_vert, bouton_jaune,bouton_rouge;
	
	
	public BufferedImage image    =  null;
	private Statement instruction;
	
	
	
	
	

	IHMImages() throws SQLException {
		
		
		
		
		File f=new File("C:\\\\Documents and Settings\\7701646E\\Bureau\\code_defaut_format_texte");
        s=f.getAbsolutePath();
        System.out.println(f.getPath());
        String[] liste=f.list();
        for (int i=0; i<liste.length; i++)
        {
        	File ff=new File(liste[i]);
            if (ff.isDirectory()) 
            	System.out.println("Dossier \t"+liste[i]);
            else 
            	System.out.println(""+ff.length()+" \t"+liste[i]);
        }
		
		
		
		
		
		String pilote = "com.mysql.jdbc.Driver";
		
		try {

            Class.forName(pilote);
            System.out.println("************************************");
            System.out.println("************************************");
            System.out.println("          Driver chargé");
            System.out.println("************************************");
            System.out.println("************************************");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
		
		
        Connection connexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/mabase","root",""); 
        instruction = connexion.createStatement();
        
        
        
        
        
        
        for (int i=0; i<liste.length; i++) 
        {
     	   ResultSet donneefichier3 = instruction.executeQuery("LOAD DATA LOCAL INFILE 'C:\\\\Documents and Settings\\\\7701646E\\\\Bureau\\\\code_defaut_format_texte"+"\\\\"+liste[i]+"' INTO TABLE table_temporaire_code_defaut FIELDS TERMINATED BY ';'LINES TERMINATED BY '\n' IGNORE 1 LINES ");
        }

        int conversion = instruction.executeUpdate("UPDATE table_temporaire_code_defaut SET Date_heure_convertie = STR_TO_DATE(Date_heure, '%d/%m/%y %T:%f')");
        
        
        /* EFFACER LA BASE DE DONNEE DE LA TABLE "table_temporaire_code_defaut"*/
        
        //int effacement_donnee = instruction.executeUpdate("DELETE FROM table_temporaire_code_defaut");
        
        
		
	
		
		
		try {
			
			this.addMouseListener(this);
	        this.train = train;
	        
			train = ImageIO.read(new File("train_123456.JPG"));
			bouton_vert = ImageIO.read(new File("bouton-vert.gif"));
			bouton_rouge = ImageIO.read(new File("bouton-rouge.gif"));
			bouton_jaune = ImageIO.read(new File("bouton-jaune.gif"));
		}
		catch(IOException exc) {
			exc.printStackTrace();
		}
		setPreferredSize(new Dimension(1018, 370));
		setBackground(Color.WHITE);
		
		
		//public void Image1(BufferedImage train) {
	        
	        
	        System.out.println(" Est dans cette fonction " );
	        
	       
	  // }
		
		
	}
	
	
	
	
	
	
	
	
	
	

	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()
	}
	
	
	
	
	
	
	
	
	
	
	 public void testLocation(Point mouse, Rectangle area, String text) throws SQLException {
         // test si la souris est dans les data de l'image
     	
     	
     	//String pilote = "com.mysql.jdbc.Driver";
	       // final Connection connexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/mabase","root",""); 
	       // final Statement instruction = connexion.createStatement();

	        


	        	if(ZONE_IMAGE_401.contains(mouse))
	        	{
	        		
	        		//final JFrame frame2 = new JFrame("ZONE_IMAGE_2 !");
	                //frame2.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	                //frame2.setSize(300, 300);
	                //frame2.setLocation(400,300);
	                //frame2.setVisible(true);
	                
	                class NewJFrame extends javax.swing.JFrame 
	            	{
	            	    public NewJFrame() throws SQLException 
	            	    {
	            	    	super("Mon tableau"); 
	            	    	
	            	        JTable monTableau1;
	            	        monTableau1 = new JTable();
	            	        
	            	      
	            	        ((DefaultTableModel)monTableau1.getModel()).setColumnCount(40);
	            	        DefaultTableModel TabModel = (DefaultTableModel) monTableau1.getModel(); 
	            	        
	            	        monTableau1.setModel(TabModel); 

	            	        
	            	        setBounds(0,370,750, 363); 
	            	        
	            	        
	            	        
	            	        /****Dimension colonnes******/
	            	        monTableau1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	            	        
	            	        TableColumn col_0 = monTableau1.getColumnModel().getColumn(0);
	            	        col_0.setPreferredWidth(100); 
	            	        
	            	        TableColumn col_2 = monTableau1.getColumnModel().getColumn(2);
	            	        col_2.setPreferredWidth(140); 
	            	        
	            	        TableColumn col_3 = monTableau1.getColumnModel().getColumn(3);
	            	        col_3.setPreferredWidth(200);
	            	        
	            	        TableColumn col_4 = monTableau1.getColumnModel().getColumn(4);
	            	        col_4.setPreferredWidth(200);
	            	        
	            	        
	            	        
	            	        
	            	        monTableau1.getTableHeader().setFont(new Font("SansSerif", Font.BOLD, 12)); 
	            	        monTableau1.getColumnModel().getColumn(0).setHeaderValue("Indice");		            	       
	            	        monTableau1.getColumnModel().getColumn(1).setHeaderValue("Caisse");
	            	        monTableau1.getColumnModel().getColumn(2).setHeaderValue("Code");
	            	        monTableau1.getColumnModel().getColumn(3).setHeaderValue("Date et heure");
	            	        monTableau1.getColumnModel().getColumn(4).setHeaderValue("Désignation");
	            	        //monTableau1.getColumnModel().getColumn(5).setHeaderValue("Autre données");
	            	        
	            	        
	            	        monTableau1.getTableHeader().resizeAndRepaint();
	            	        
	            	        
	            	        JScrollPane scrollPane = new JScrollPane( monTableau1);
	            	        JTableHeader header = monTableau1.getTableHeader(); 
	            	        //header.setBackground(Color.gray); 
	            	        getContentPane().add(scrollPane); 
	            	        
	            	        /********* CENTRE LES DONNEES *******/
	            	        
	      	        		  DefaultTableCellRenderer custom = new DefaultTableCellRenderer(); 
	      	        		  custom.setHorizontalAlignment(JLabel.CENTER); // centre les données de ton tableau
	      	        		  for (int i=0 ; i < monTableau1.getColumnCount() ; i++) // centre chaque cellule de ton tableau
	      	        			  monTableau1.getColumnModel().getColumn(i).setCellRenderer(custom); 
	            	    
	            	        /*************************************/
	            	        
	            	        
	            	        
	            	        
	            	        
	            	        
	            	    
	            	
	                
	                
	                System.out.println(" 401 : CLIC\n\n" );
	        		
	        		ResultSet Rame_401_262502 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%262502%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%262502%') ORDER BY Date_heure_convertie");
	        		ResultSet Rame_401_26502 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26502%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26502%' ) ORDER BY Date_heure_convertie");
	        		ResultSet Rame_401_262501 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%262501%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%262501%' ) ORDER BY Date_heure_convertie");
	        		ResultSet Rame_401_26501 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26501%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26501%' ) ORDER BY Date_heure_convertie");
	        		
	        		//ResultSetTableModel rtm = new ResultSetTableModel( Rame_401_26501);

	        		
	        		
	        		//int i=0;
	        		
	        		
	        		/*while(Rame_401_26501.next())
    	        	{

    	        		monTableau1.setValueAt(Rame_401_26501.getString("Caisse"), i, 0);
    	        		monTableau1.setValueAt(Rame_401_26501.getString("Code"), i, 1);
    	        		monTableau1.setValueAt(Rame_401_26501.getString("Date_heure"), i, 2);
    	        		monTableau1.setValueAt(Rame_401_26501.getString("Designation"), i, 3);
	
    	        		i++;

    	        	}*/
	        		 java.sql.ResultSetMetaData rsmd = Rame_401_26501.getMetaData(); 
	        	      int colNo = rsmd.getColumnCount(); 
	        	    while(Rame_401_26501.next()) 
	        	    { 
	        	     Object[] ligne = new Object[colNo]; 
	        	     for(int i = 0; i < colNo; i++){ 
	        	      ligne[i] = Rame_401_26501.getObject(i + 1); 
	        	       } 
	        	     TabModel.addRow(ligne); 
	        	    }
	        	    
	        	    /*public void paintComponent(Graphics g) {
	        			super.paintComponents(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, 100, 50, this);
	        	    }*/
	            	    
	        	     

    	        	//System.out.println("I : NOMBRE DE CODE ENREGISTREE : "+i);
    	        	//((monTableau1) monTableau1).addRow(i); 
    	        	//((DefaultTableModel)monTableau1.getModel()).setColumnCount(i);
         	       

    	        	
	        		
	        		
	        		
	        		
	        		
	        		/*
	        		System.out.println("******************DEBUT***********************");
	        		System.out.println("*********** Rame : 401 Caisse : 26501*********");
	        		System.out.println("**********************************************");
	        		
	        		
	        		
	                while(Rame_401_26501.next())
	                {
	                	System.out.println("Caisse: "+Rame_401_26501.getString("Caisse"));
	                	System.out.println("Code: "+Rame_401_26501.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_401_26501.getString("Date_heure"));
	                	System.out.println("\n");    
	                }
	                
	                System.out.println("*******************FIN************************");
	        		System.out.println("*********** Rame : 401 Caisse : 26501*********");
	        		System.out.println("**********************************************");
	        		*/
	        		
	        	/*	System.out.println("******************DEBUT***********************");
	        		System.out.println("*********** Rame : 401 Caisse : 262501*********");
	        		System.out.println("**********************************************");
	        		
	                while(Rame_401_262501.next())
	                {
	                	System.out.println("Caisse: "+Rame_401_262501.getString("Caisse"));
	                	System.out.println("Code: "+Rame_401_262501.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_401_262501.getString("Date_heure"));
	                	System.out.println("\n");
	                    
	                }
	                
	                System.out.println("*******************FIN************************");
	        		System.out.println("*********** Rame : 401 Caisse : 262501*********");
	        		System.out.println("**********************************************");
	        		*/
	        		
	        		/*
	        		System.out.println("******************DEBUT***********************");
	        		System.out.println("*********** Rame : 401 Caisse : 262502*********");
	        		System.out.println("**********************************************");
	        		
	                while(Rame_401_262502.next())
	                {
	                	System.out.println("Caisse: "+Rame_401_262502.getString("Caisse"));
	                	System.out.println("Code: "+Rame_401_262502.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_401_262502.getString("Date_heure"));
	                	System.out.println("\n");
	                    
	                }
	                
	                System.out.println("*******************FIN************************");
	        		System.out.println("*********** Rame : 401 Caisse : 262502*********");
	        	    System.out.println("**********************************************");
	        		
	        	  
	        	 
	        		System.out.println("******************DEBUT***********************");
	        		System.out.println("*********** Rame : 401 Caisse : 26502*********");
	        		System.out.println("**********************************************");
	        		
	                while(Rame_401_26502.next())
	                {
	                	System.out.println("Caisse: "+Rame_401_26502.getString("Caisse"));
	                	System.out.println("Code: "+Rame_401_26502.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_401_26502.getString("Date_heure"));
	                	System.out.println("\n");
	                    
	                }
	                
	                System.out.println("*******************FIN************************");
	        		System.out.println("*********** Rame : 401 Caisse : 26502*********");
	        		System.out.println("**********************************************");
	        		
	        		*/
	            	    }
	            	    //new NewJFrame().setVisible(true);
	            	}
	                
	                new NewJFrame().setVisible(true);
	                
	        	}  
	        	else if(ZONE_IMAGE_404.contains(mouse))
	            {
	        		System.out.println(" 404 : CLIC\n\n" );
	        		
	        		ResultSet Rame_404 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26507%' OR '%262507%' OR '%262508%' OR '%26508%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26507%' OR '%262507%' OR '%262508%' OR '%26508%' ) ORDER BY Date_heure_convertie");

	        		
	        		//Par défaut, on dit qu'il est vide
	        		boolean isEmpty = true;

	        		
	                while(Rame_404.next())
	                {
	                	isEmpty = false;
           	
	                	System.out.println("\n");
	                	System.out.println("Caisse: "+Rame_404.getString("Caisse"));
	                	System.out.println("Code: "+Rame_404.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_404.getString("Date_heure"));
	                	System.out.println("\n");
	                	
	                	
	                	if (Rame_404.getString("Code").equals("1006"))
	                	{
	                		
	                		System.out.print("OKOKOKOKOKOKOKOKOKOK\n");
	                		System.out.print("isEmpty : "+isEmpty);
	                		
	                		/*****************************************************/
	                		/*****************************************************/   		
	                		/****************C'EST ICI QUE JE SOUHAITE************/
	                		/********************METTRE A JOUR********************/
	                		/**********************MON IMAGE**********************/
	                		/*****************************************************/
	                		/*****************************************************/   			                		
	                	}
	                		


	                	
	                    
	                }
	            }
	        	else if(ZONE_IMAGE_406.contains(mouse))
	            {
	        		System.out.println(" 406 : CLIC\n\n" );  
	        		
	        		ResultSet Rame_406 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26511%' OR '%262511%' OR '%262512%' OR '%26512%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26511%' OR '%262511%' OR '%262512%' OR '%26512%' ) ORDER BY Date_heure_convertie");

	                while(Rame_406.next())
	                {
	                	System.out.println("Caisse: "+Rame_406.getString("Caisse"));
	                	System.out.println("Code: "+Rame_406.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_406.getString("Date_heure"));
	                	System.out.println("\n");
	                    
	                }
	             }
	        	else if(ZONE_IMAGE_409.contains(mouse))
	            {
	        		System.out.println(" 409 : CLIC\n\n" );
	        		
	        		ResultSet Rame_409 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26517%' OR '%262517%' OR '%262518%' OR '%26518%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26517%' OR '%262517%' OR '%262518%' OR '%26518%' ) ORDER BY Date_heure_convertie");

	                while(Rame_409.next())
	                {
	                	System.out.println("Caisse: "+Rame_409.getString("Caisse"));
	                	System.out.println("Code: "+Rame_409.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_409.getString("Date_heure"));
	                	System.out.println("\n");   
	                }
	            }
	        	else if(ZONE_IMAGE_411.contains(mouse))
	            {
	        		System.out.println(" 411 : CLIC\n\n" );
	        		
	        		ResultSet Rame_411 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26521%' OR '%262521%' OR '%262522%' OR '%26522%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26521%' OR '%262521%' OR '%262522%' OR '%26522%' ) ORDER BY Date_heure_convertie");

	                while(Rame_411.next())
	                {
	                	System.out.println("Caisse: "+Rame_411.getString("Caisse"));
	                	System.out.println("Code: "+Rame_411.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_411.getString("Date_heure"));
	                	System.out.println("\n");  
	                }
	            }
	        	else if(ZONE_IMAGE_413.contains(mouse))
	            {
	        		System.out.println(" 413 : CLIC\n\n" );
	        		
	        		ResultSet Rame_413 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26525%' OR '%262525%' OR '%262526%' OR '%26526%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26525%' OR '%262525%' OR '%262526%' OR '%26526%' ) ORDER BY Date_heure_convertie");

	                while(Rame_413.next())
	                {
	                	System.out.println("Caisse: "+Rame_413.getString("Caisse"));
	                	System.out.println("Code: "+Rame_413.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_413.getString("Date_heure"));
	                	System.out.println("\n");  
	                }
	            }
	        	else if(ZONE_IMAGE_415.contains(mouse))
	            {
	        		System.out.println(" 415 : CLIC\n\n" );
	        		
	        		ResultSet Rame_415 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26529%' OR '%26530%' OR '%262529%' OR '%262530%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26529%' OR '%26530%' OR '%262529%' OR '%262530%' ) ORDER BY Date_heure_convertie");

	                while(Rame_415.next())
	                {
	                	System.out.println("Caisse: "+Rame_415.getString("Caisse"));
	                	System.out.println("Code: "+Rame_415.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_415.getString("Date_heure"));
	                	System.out.println("\n");
	                    
	                }
	            }
	        	else if(ZONE_IMAGE_432.contains(mouse))
	            {
	        		System.out.println(" 432 : CLIC\n\n" );
	        		
	        		ResultSet Rame_432 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26563%' OR '%262563%' OR '%262564%' OR '%26564%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26563%' OR '%262563%' OR '%262564%' OR '%26564%' ) ORDER BY Date_heure_convertie");

	                while(Rame_432.next())
	                {
	                	System.out.println("Caisse: "+Rame_432.getString("Caisse"));
	                	System.out.println("Code: "+Rame_432.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_432.getString("Date_heure"));
	                	System.out.println("\n");  
	                }
	            }
	        	else if(ZONE_IMAGE_433.contains(mouse))
	            {
	        		System.out.println(" 433 : CLIC\n\n" );
	        		
	        		ResultSet Rame_433 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26565%' OR '%262565%' OR '%262566%' OR '%26566%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26565%' OR '%262565%' OR '%262566%' OR '%26566%' ) ORDER BY Date_heure_convertie");

	                while(Rame_433.next())
	                {
	                	System.out.println("Caisse: "+Rame_433.getString("Caisse"));
	                	System.out.println("Code: "+Rame_433.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_433.getString("Date_heure"));
	                	System.out.println("\n");  
	                }
	            }
	        	else if(ZONE_IMAGE_434.contains(mouse))
	            {
	        		System.out.println(" 434 : CLIC\n\n" );
	        		
	        		ResultSet Rame_434 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26567%' OR '%262567%' OR '%262568%' OR '%26568%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26567%' OR '%262567%' OR '%262568%' OR '%26568%' ) ORDER BY Date_heure_convertie");

	                while(Rame_434.next())
	                {
	                	System.out.println("Caisse: "+Rame_434.getString("Caisse"));
	                	System.out.println("Code: "+Rame_434.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_434.getString("Date_heure"));
	                	System.out.println("\n");  
	                }
	            }
	        	else if(ZONE_IMAGE_435.contains(mouse))
	            {
	        		System.out.println(" 435 : CLIC\n\n" );
	        		
	        		ResultSet Rame_435 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26569%' OR '%262569%' OR '%262570%' OR '%26570%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26569%' OR '%262569%' OR '%262570%' OR '%26570%' ) ORDER BY Date_heure_convertie");

	                while(Rame_435.next())
	                {
	                	System.out.println("Caisse: "+Rame_435.getString("Caisse"));
	                	System.out.println("Code: "+Rame_435.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_435.getString("Date_heure"));
	                	System.out.println("\n");  
	                }
	            }
	        	else if(ZONE_IMAGE_436.contains(mouse))
	            {
	        		System.out.println(" 436 : CLIC\n\n" );
	        		
	        		ResultSet Rame_436 = instruction.executeQuery("SELECT * FROM table_temporaire_code_defaut WHERE Caisse LIKE '%26571%' OR '%262571%' OR '%262572%' OR '%26572%' HAVING Date_heure_convertie >= (select max(Date_heure_convertie) from table_temporaire_code_defaut WHERE Code = '1008' and Caisse LIKE '%26529%' OR '%26530%' OR '%262529%' OR '%262530%' ) ORDER BY Date_heure_convertie");

	                while(Rame_436.next())
	                {
	                	System.out.println("Caisse: "+Rame_436.getString("Caisse"));
	                	System.out.println("Code: "+Rame_436.getString("Code"));
	                	System.out.println("Date_heure: "+Rame_436.getString("Date_heure"));
	                	System.out.println("\n");  
	                }
	        		
	        		
	            }
         
	        	
         
        }
	

	 
	 
	private void drawImage(Image train2, int i, int j, IHMImages ihmImages) {
		// TODO Auto-generated method stub
		
	}











	@Override
	public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub
		 Point p = e.getPoint();
         try {
				testLocation(p, ZONE_IMAGE_406, "mouseClicked - data 1");
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			} finally {
				// TODO Auto-generated catch block
				
			}
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		Point p = e.getPoint();
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		Point p = e.getPoint();
		
	}

}