I\'ve a JFrame subclass that manage my UI and call a method of Item Object to import items in my DB:
public TestGUI() throws IOException
{
initComponents();
What you can do is move the table.refresh();
code at the end of the child thread code and use SwingUtilities.InvokeLater
to forward it to the GUI thread event queue:
public void run() {
//...
SwingUtilities.InvokeLater(
new Runnable() {
public void run() {
table.refresh();
}
});
}
That way you are executing it on the GUI thread but only when the child thread finished its work.