Depending on the processing power needed to fill the data, you could use a javax.swing.Timer or a javax.swing.SwingWorker. Use the JTable's setValueAt method (or its model's setValueAt method) to update the values.
If the values just need to be set a Timer should be enough. If you need a heavy calculation you don't want to use Timer since the code will then be run on the Event Dispatcher
Thread (EDT), during which time the user interface is not responsive. A SwingWorker will then be better, using its publish / process methods. See
this thread for more information. But how it should work, basically, is this:
- doInBackground does the hard work.
- now and then it uses publish to indicate a new value is ready. You probably need a little container class that stores the row, column and value.
- process then only uses those values to set them in the table / model.