title: How to add row instantly in Jtable while receiving data from socket in JAVA?
body: <p>I have tried to create a program that can view real-time data on jtable from the socket. Program run properly and received data from socket and can be printed on the output terminal. But apending (add row) on Jtable is not working. What i have done wrong and what would be the right way to do that?
  Here is my code snap,</p>
  <pre><code>public void run(){
  
      try {
              DatagramSocket aSocket = new DatagramSocket (6666);
              byte[] buffer = new byte[1000];
  
              while (true) {
                      DatagramPacket request = new DatagramPacket (buffer, buffer.length);
                      aSocket.receive (request);
                      String message[]  = new String(request.getData(), 0,request.getLength()).split(&quot;,&quot;);
                      
                      
                      DefaultTableModel table = (DefaultTableModel) jTable1_liveTable.getModel();
                      table.addRow(new Object[]{message[0],message[1],message[2],message[3],message[4]});
                   }   
              
          } catch (Exception ex) {
              ex.printStackTrace();
          } 
  </code></pre>