irritating NPE in BasicScrollBarUI

Hi,

Having this stack trace in stdout. Not quite sure what makes it happen. This stack trace is all I have. It does not happen consistently but sometimes, I think when I move the mouse while the screen is getting painted. I have java 5.0 running on windows with windows look & feel.

Would appreciate any tips. Thanks.

Exception in thread"AWT-EventQueue-0" java.lang.NullPointerException

at javax.swing.plaf.basic.BasicScrollBarUI.layoutVScrollbar(Unknown Source)

at javax.swing.plaf.basic.BasicScrollBarUI.layoutContainer(Unknown Source)

at java.awt.Container.layout(Unknown Source)

at java.awt.Container.doLayout(Unknown Source)

at java.awt.Container.validateTree(Unknown Source)

at java.awt.Container.validateTree(Unknown Source)

at java.awt.Container.validateTree(Unknown Source)

at java.awt.Container.validateTree(Unknown Source)

at java.awt.Container.validateTree(Unknown Source)

at java.awt.Container.validate(Unknown Source)

at javax.swing.plaf.basic.BasicTabbedPaneUI.ensureCurrentLayout(Unknown Source)

at javax.swing.plaf.basic.BasicTabbedPaneUI.getTabBounds(Unknown Source)

at javax.swing.plaf.basic.BasicTabbedPaneUI.repaintTab(Unknown Source)

at javax.swing.plaf.basic.BasicTabbedPaneUI.setFocusIndex(Unknown Source)

at javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.focusGained(Unknown Source)

at java.awt.Component.processFocusEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)

at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)

at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.SequencedEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

[2802 byte] By [naimdjona] at [2007-10-3 8:41:46]
# 1

One outside possibility is that it could be caused by Swing methods being called outside of the EDT - if this is the case then you can get race conditions for some field values which are avoided if everything's done on the EDT.

Check your code to make sure it's building and adding all Swing components on the EDT.

itchyscratchya at 2007-7-15 3:50:07 > top of Java-index,Desktop,Core GUI APIs...