0

I hava application which I'm using to present data from DB. I'm using hibernate which is great. All I need is to build mechanism to auto refresh JTable.

Right now I'm rebuilding table every minute. I would like to refresh cells without this process. I figure out the best way to do it is to implement table model.

In one of table cells I have my Object ( ex. User ) the problem is that when I'm caling SQL query I'm getting new object list and I'm getting error from JTable.

I know that I can update objects one by obe but this is not optimal.

Any help, tutorial etc.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
kingkong
  • 1,537
  • 6
  • 27
  • 48

1 Answers1

1

Execute your query periodically in your implementation of doInBackground() in a subclass of SwingWorker. The process() method allows the model to be updated on the EDT. Examples may be found in the API, here and here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045