Colliding actions on ProgressPanel ? NullPointerException in "AWT-EventQueue-0"

My CMD window shows exceptions like this from time to time when certain activities (e.g. opening the partner window) are being performed in the AS2 GUI:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.desktop/javax.swing.plaf.basic.BasicProgressBarUI.sizeChanged(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(Unknown Source)
:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.desktop/javax.swing.plaf.basic.BasicProgressBarUI.updateSizes(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicProgressBarUI.getBox(Unknown Source)
:

As far as I was able to find out, this is likely connected to Swing not being "thread safe" and multiple threads accessing Swing/AWT components in parallel.
In my further investigation, I looked up the source code for class "de.mendelson.util.ProgressPanel".

Method "displayProgressBar" makes use of "SwingUtilities.invokeAndWait" ... which is good and "as recommended", I think.
On the other hand, method "disableProgressDisplay" does not use "invokeAndWait" or "invokeLater".

Shouldn't "disableProgressDisplay" enqueue its GUI related commands to the Swing eventqueue as well ?

... since the same Swing/AWT components ("jProgressBar" and "jLabelProgressDetails") are affected as in "displayProgressBar".
... and since "disableProgressDisplay" is executed in separate threads as well. (... via "stopProgressIfExists", as initiated from class AS2Gui)

Foren
AS2

Comments