I’ve got a java.util.List bind to a JTable, if I want to refresh the table using
- bindingGroup.unbind();
- bindingGroup.bind();
I get this exception:
Exception in thread “Thread-8” java.lang.UnsupportedOperationException: Can not call this method on a managed binding
relative to the 2nd line above.
Below more specific code:
new Thread(
new Runnable(){
public void run(){
fireProgressBar(true,"working...");
controller.doSmoething();
fireProgressBar(false,"");
bindingGroup.unbind();
bindingGroup.bind();
jTable1.revalidate();
}
}
).start();
fireProgressBar is a simple method that I wrote for jProgressBar activation, nothing here is involved in binding.
the bindingGroup.bind() call throws the exception above.
I tried also with SwingUtilities.invokeLater instead of new Thread(….).start();
but I get the same issue.
Thanks.
1) this code is always done in EDT, in other hands in one moment refreshed in the GUI
wrong way inside
Runnable#Threadwithout use forinvokeLater()correct way inside
Runnable#Threadwrapped intoinvokeLater()2) you have two ways
look at SwingWorker and JProgressBars
same way inside
Runnable#Threadand output to the GUI must be wrapped intoinvokeLater()3) in moment that you’ll to able to manage whole stepped progresses inside Background task(s), then you can implements for
Binding