This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 48199 - NullPointerException from Swing FileChooser
Summary: NullPointerException from Swing FileChooser
Status: CLOSED DUPLICATE of bug 38479
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: L&F, RANDOM
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-08-30 23:39 UTC by bcbeck
Modified: 2006-03-24 10:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log file (38.57 KB, text/plain)
2004-08-30 23:40 UTC, bcbeck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bcbeck 2004-08-30 23:39:10 UTC
In the Project Properties dialog, under
Build->Compiling Sources, I pressed the "Add Jar
File" button and got the following NPE:

java.lang.NullPointerException
	at javax.swing.ImageIcon.<init>(ImageIcon.java:161)
	at javax.swing.ImageIcon.<init>(ImageIcon.java:147)
	at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI$ShortCutPanel.<init>(WindowsFileChooserUI.java:603)
	at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(WindowsFileChooserUI.java:361)
	at
javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:130)
	at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:176)
	at javax.swing.JComponent.setUI(JComponent.java:449)
	at
javax.swing.JFileChooser.updateUI(JFileChooser.java:1701)
	at
javax.swing.JFileChooser.setup(JFileChooser.java:345)
	at
javax.swing.JFileChooser.<init>(JFileChooser.java:320)
	at
javax.swing.JFileChooser.<init>(JFileChooser.java:273)
	at
org.netbeans.modules.java.j2seproject.ui.customizer.VisualClasspathSupport$ClasspathSupportListener.actionPerformed(VisualClasspathSupport.java:295)
	at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
	at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
	at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
	at
java.awt.Component.processMouseEvent(Component.java:5100)
	at
java.awt.Component.processEvent(Component.java:4897)
	at
java.awt.Container.processEvent(Container.java:1569)
	at
java.awt.Component.dispatchEventImpl(Component.java:3615)
	at
java.awt.Container.dispatchEventImpl(Container.java:1627)
	at
java.awt.Component.dispatchEvent(Component.java:3477)
	at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
	at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
	at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
	at
java.awt.Container.dispatchEventImpl(Container.java:1613)
	at
java.awt.Window.dispatchEventImpl(Window.java:1606)
	at
java.awt.Component.dispatchEvent(Component.java:3477)
[catch] at
java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
	at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Comment 1 bcbeck 2004-08-30 23:40:57 UTC
Created attachment 17232 [details]
messages.log file
Comment 2 Jesse Glick 2004-08-30 23:51:08 UTC
Why 'nbbuild'? That is used for the NB build process, not even part of
the distributed IDE at all. Use the component 'ide' if you are not
sure where to file a bug.

Looks like some bug in the Win L&F. Reporter, please try 1.4.2_04.
Comment 3 Jesse Glick 2004-08-30 23:51:26 UTC
May be unreproducible.
Comment 4 bcbeck 2004-08-31 00:29:51 UTC
I have not been able to reproduce it myself since it happened.  It is
also worth showing this stack trace to the Swing FileChooser owner to
see if it might be a JDK problem.
Comment 5 _ tboudreau 2004-08-31 08:15:15 UTC
I fixed this a couple days ago.  It is a bug in Windows L&F, but you can work around it by 
forcing the file chooser ui to initialize during startup (basically just run the code that 
produces an NPE until it doesn't).  Windows L&F loads system icons lazily on some 
background thread, but the file chooser UI can try to use them before they are loaded.

It is not a problem in 1.5.

*** This issue has been marked as a duplicate of 38479 ***
Comment 6 Lukas Hasik 2004-09-02 10:11:55 UTC
v