I've created a jtable which can load data from tables in the database, im trying to show all updated or new records captured with a refresh button. Im using java, swing and mysql as my database.
Asked
Active
Viewed 102 times
-2
-
1for better help sooner post an [SSCCE](http://sscce.org/), short, runnable, compilable, with value for JTable hardcoded as local variable – mKorbel May 17 '13 at 09:21
-
2Do you have a question? – JB Nizet May 17 '13 at 09:23
-
Since that will require a new query to the database, the easiest way is probably to use a `SwingWorker` to perform the query and construct a new `TableModel` in the background. Then you simply replace the `TableModel` of your `JTable` on the EDT – Robin May 17 '13 at 09:26
1 Answers
2
read Oracle tutorial How to Use Tables
description about Creating a Table Model for updates to
JTable
on runtimeall updates to the already visible GUI must be done on EDT, (in your case) could be invoked from SwingWorker, otherwise you'll an issue with Concurency in Swing and your GUI will be freeeze until hard and long running Object from JDBC ended

mKorbel
- 109,525
- 20
- 134
- 319