bonjour à tous
je suis un etudiant et j'ai besoin d'aide àproposde jtable
on faite j'ai une application qui joue le role d'un serveur qui recoit des trames et qui les affiche dans jtable
mais le probleme c que je veut qu il ya un rafraichisement de la table chaque fois q'une trame et afficher en faitmon application se bloque pour un memont puis elle les affiche tous ensemble etmoi je veux un affichage en temps reel
j'ai essayé repaint mais le probleme persiste
voici le code
//***************
void jB_start_actionPerformed(ActionEvent e) {
try{
while(true){
Date date = new Date();
socket.receive(packet);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat timef = new SimpleDateFormat("HH:mm");
String s = timef.format(new Date(System.currentTimeMillis()));
data[0] = sdf.format(date).toString();
data[1] = s;
String packet_string = new
String(log_buffer, 0, 0, packet.getLength());
data[3]= packet.getAddress().getHostAddress().toString();
data[5]=packet_string ;
System.out.println(packet_string+s);
statsTableModel.addRow(data);
statsTableModel.fireTableDataChanged();
jTable1.repaint();
}
}
catch(Exception et) {
JOptionPane.showMessageDialog(null, "Wrong password");
}
}