Hello.
I'm doing an applet using Swing. I've set Nimbus LAF first think in init() and called SwingUtilities.updateComponentTreeUI() just in case.
I have a JProgressBar that I update during a long calculation. My long calculation is done on the doBackground() of the SwingWorker. I call a method to set the JProgressBar indeterminate, maximum, minimum and progress values. All those methods are called using SwingUtilities.invokeLater(). All of them work fine EXCEPT setIndeterminate(), that throws the following NPE.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.plaf.synth.SynthLookAndFeel.getStyle(SynthLookAndFeel.java:210)
at javax.swing.plaf.synth.SynthLookAndFeel.updateStyle(SynthLookAndFeel.java:266)
at javax.swing.plaf.synth.SynthProgressBarUI.updateStyle(SynthProgressBarUI.java:59)
at javax.swing.plaf.synth.SynthProgressBarUI.propertyChange(SynthProgressBarUI.java:318)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:318)
at java.awt.Component.firePropertyChange(Component.java:8237)
at javax.swing.JComponent.firePropertyChange(JComponent.java:4440)
at javax.swing.JProgressBar.setIndeterminate(JProgressBar.java:918)
at my.code.NotificationBar$3.run(NotificationBar.java:120) // My own runnable that calls invokeLater() if we're not on EDT and only has the line bar.setIndeterminate(true/false)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Change really occurs, and I can see the bar turning indeterminate, but I don't like having unknowns exceptions being thrown in my code.
Anyone have any idea?
Thanks a lot in advance!