I have done a project with LookAndFeel
Substance
, in it I have a thread
that is updating periodically a JProgressBar
, the problem is that in the function JProgressBar.setValue(1)
and JProgressBar.setMaximum(10)
the following exception occurs:
org.pushingpixels.substance.api.UiThreadingViolationException: Component state change must be done on Event Dispatch Thread
at org.pushingpixels.substance.internal.utils.SubstanceCoreUtilities.testComponentStateChangeThreadingViolation(SubstanceCoreUtilities.java:2072)
at org.pushingpixels.substance.internal.ui.SubstanceProgressBarUI$SubstanceChangeListener.stateChanged(SubstanceProgressBarUI.java:87)
at javax.swing.JProgressBar.fireStateChanged(JProgressBar.java:729)
at javax.swing.JProgressBar$ModelListener.stateChanged(JProgressBar.java:652)
at javax.swing.DefaultBoundedRangeModel.fireStateChanged(DefaultBoundedRangeModel.java:364)
at javax.swing.DefaultBoundedRangeModel.setRangeProperties(DefaultBoundedRangeModel.java:302)
at javax.swing.DefaultBoundedRangeModel.setMaximum(DefaultBoundedRangeModel.java:219)
at javax.swing.JProgressBar.setMaximum(JProgressBar.java:898)
I want to know how I can correct this problem, or maybe suppress it , since it does not impact my layout.