Bonjour, j'ai une problème depuis deux semaines, je suis en apprentissage et je suis en projet pour mon entreprise. J'ai un JTable qui récupère des informations dans un fichier Log. Le fichier log se rafraichi tout seul toute les 2 min avec un Script Python à part. Donc dans un tableau j'aimerai afficher les informations que je sélectionne (ce qui est déjà le cas) et que le tableau se rafraichisse toute les 5 min. Problème, je ne sais pas du tout comment faire j'ai essayé avec ((AbstractTableModel) tableur).fireTableDataChanged() car mon tableau est un DefaultTableModel() bouton sans boucle et même avec ça je ne sais pas comment trop faire. Voici tout mon code :
Ma fenêtre :
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
 
public class Fenetre extends JFrame implements ActionListener{ 
 
	private static final long serialVersionUID = 1L;
 
	private JPanel pan = new JPanel();
	private JButton bouton;
	private JTable tableau; 
	private DefaultTableModel tableur;
 
	private Object recup;
 
	public Fenetre() throws InterruptedException{
 
	    this.setVisible(false);
	    this.setLocationRelativeTo(null);
	    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	    this.setTitle("Statut @dom");
	    this.setSize(1280, 150);
		Recuperation recup = new Recuperation();
		recup.recup();
 
 
		String  title[] = {"Nom", "Adresse IP Réelle", "Adresse IP Virtuelle", "Bits Reçus", "Bits envoyés", "Connecté depuis :", "Dernière Actualisation"};
		tableur = new DefaultTableModel((Object[][]) recup.Tableau(), title);
		tableau = new JTable(tableur);
	    bouton = new JButton("Actualiser");
	    bouton.addActionListener(this);
	    this.setLayout(new GridLayout(2, 1));
	    this.getContentPane().add(new JScrollPane(tableau)); 
	    pan.add(bouton);
	    this.getContentPane().add(pan);
	    this.setVisible(true);	    
	}
	public void actionPerformed(ActionEvent e) {
		Object source = e.getSource();
		if (source == bouton) {
			JOptionPane jop1 = new JOptionPane();
			JOptionPane.showMessageDialog(null, "Actualiser", "Information", JOptionPane.INFORMATION_MESSAGE);
			((AbstractTableModel) tableur).fireTableDataChanged();
		}
 
	}
 
 
}
Ma Récupération de Data :
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
 
public class Recuperation {
 
	File file = new File("files/utile files/openvpn-status.log");
	public String nom1;
	public String rip1;
	public String vip1;
	public String br1 = "";
	public String be1;
	public String cd1;
	public String da1;
 
	public String nom2;
	public String rip2;
	public String vip2;
	public String br2 = "";
	public String be2;
	public String cd2;
	public String da2;
 
 
 
	@SuppressWarnings("resource")
	public void recup() {
 
 
		try {
			FileReader fileReader = new FileReader(this.file);
			BufferedReader bufferedReader = new BufferedReader(fileReader);
 
			String line ;
			while((line = bufferedReader.readLine()) != null) {
				if (line.matches("^vdommage.*")){
					String[] tline = line.split(",");
					for (String i : tline){
					    if (i.matches("^vdommage.*")) {
					    	nom1 = "";
					    	nom1 = i;
					    } else if (i.matches("\\p{Digit}+") && !br1.matches("")) {
					    	be1 = "";
					    	be1 = i;
					    } else if (i.matches("\\p{Digit}+") && br1.matches("")) {
					    	br1 = "";
					    	br1 = i;
					    }  else if (i.matches("^176..*")) {
					    	rip1 = "";
					    	rip1 = i;
					    }  else if (i.matches("^Mon.*") || i.matches("^Tue.*") || i.matches("^Wed.*") || i.matches("^Thu.*") || i.matches("^Fri.*") || i.matches("^Sat.*") || i.matches("^Sun.*")) {
					    	cd1 = "";
					    	cd1 = i;
					    }
					}
				} else if (line.matches("^ehocini.*")) {
					String[] tline = line.split(",");
					for (String i : tline){
					    if (i.matches("^ehocini.*")) {
					    	nom2 = "";
					    	nom2 = i;
					    } else if (i.matches("\\p{Digit}+") && !br2.matches("")) {
					    	be2 = "";
					    	be2 = i;
					    } else if (i.matches("\\p{Digit}+") && br2.matches("")) {
					    	br2 = "";
					    	br2 = i;
					    }  else if (i.matches("^37..*")) {
					    	rip2 = "";
					    	rip2 = i;
					    }  else if (i.matches("^Mon.*") || i.matches("^Tue.*") || i.matches("^Wed.*") || i.matches("^Thu.*") || i.matches("^Fri.*") || i.matches("^Sat.*") || i.matches("^Sun.*")) {
					    	cd2 = "";
					    	cd2 = i;
					    }
					}
				} else if (line.matches("^192.168.135.174.*")) {
					String[] tline = line.split(",");
					for (String i : tline){
						if (i.matches("^192..*")) {
							vip1 = "";
							vip1 = i;
					    } else if (i.matches("^Mon.*") || i.matches("^Tue.*") || i.matches("^Wed.*") || i.matches("^Thu.*") || i.matches("^Fri.*") || i.matches("^Sat.*") || i.matches("^Sun.*")) {
					    	da1 = "";
					    	da1 = i;
					    }
					}
				} else if (line.matches("^192.168.135.166.*")) {
					String[] tline = line.split(",");
					for (String i : tline){
						if (i.matches("^192..*")) {
							vip2 = "";
							vip2 = i;
					    } else if (i.matches("^Mon.*") || i.matches("^Tue.*") || i.matches("^Wed.*") || i.matches("^Thu.*") || i.matches("^Fri.*") || i.matches("^Sat.*") || i.matches("^Sun.*")) {
					    	da2 = "";
					    	da2 = i;
					    }
					}
				}
 
			}
			bufferedReader.close();
			fileReader.close();
 
 
 
		} catch(FileNotFoundException e) {
			System.err.printf("Le fichier %s n'as pas ete trouve", file.toString());
		} catch(IOException e) {
			System.err.println("Impossible de lire le contenu du fichier " + file.toString());
		}
 
	}
 
	public  Object Tableau() {
		Object[][] data = {
			{nom1.toUpperCase(), rip1, vip1, br1, be1, cd1, da1},
			{nom2.toUpperCase(), rip2, vip2, br2, be2, cd2, da2}
		};
		return data;
	}
	public Recuperation() {
 
	}
 
}

Et mon Main:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
public class Main {
	public static void main(String[] args) throws InterruptedException{
		Fenetre fen = new Fenetre();
		fen.setVisible(true);
 
 
	}   
}
Et pour finir voici mon fichier log:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
OpenVPN CLIENT LIST
Updated,Wed Jan 16 10:06:08 2019
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
ehocini,37.ADRESSE IP PUBLIC 1,3550061,3859629,Tue Jan 15 18:28:35 2019
vdommage,176.ADRESSE IP PUBLIC 2,2964137,48658741,Wed Jan 16 08:19:43 2019
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
192.168.135.174,vdommage,176.ADRESSE IP PUBLIC 1,Wed Jan 16 10:06:07 2019
192.168.135.166,ehocini,37.ADRESSE IP PUBLIC 2,Wed Jan 16 10:05:16 2019
GLOBAL STATS
Max bcast/mcast queue length,4
END
Merci d'avance ,

ViDaaX.