Duplicate :
|
I am executing an applet that uses a JEditorPane and a FileChooser, in Nimbus LAF. When the applet is loaded, I am clicking on the 'Open' button. A filechooser opens up. Now choose a folder from the 'Look in' combo box preferably, something located on the desktop. File list will be shown in the file chooser. Click one of the files. Now open the 'look in' combo box again and choose a different folder from the combo, located on the desktop. You will immediately see the below exception on the console. If you don't get it the first time. Try repeating the sequence a few times. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1349) at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1292) at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.java:2605) at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167) at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:147) at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:194) at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:388) at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:398) at javax.swing.DefaultListSelectionModel.removeSelectionIntervalImpl(DefaultListSelectionModel.java:559) at javax.swing.DefaultListSelectionModel.clearSelection(DefaultListSelectionModel.java:403) at sun.swing.FilePane.clearSelection(FilePane.java:1561) at sun.swing.FilePane$4.contentsChanged(FilePane.java:482) at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:100) at javax.swing.plaf.basic.BasicDirectoryModel.fireContentsChanged(BasicDirectoryModel.java:151) at javax.swing.plaf.basic.BasicDirectoryModel$DoChangeContents.run(BasicDirectoryModel.java:480) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) I reproduced it on WinXP - classic theme using IE7 as well as AppletViewer, with JDK6u10-b11+. This bug is actually looking ugly since the exception comes almost immediately within few clicks. After that, the same exception is repeated whenever I click anything from the combobox. I have attached the test herewith (JEditorPaneTest.html/java).