File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Problem in JFileChooser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem in JFileChooser" Watch "Problem in JFileChooser" New topic

Problem in JFileChooser

Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 180

My program is a frame in which there is a button and by clicking the button filechooser dialog box opens

Program works well when I run with command "javaw Filename" but shows error when I run with "java Filename" when work with file dialog (sometime when selecting any file and also when cancel without selecting any file )try 2 3 time

The error is:-

C:\Documents and Settings\titu\My Documents\java rev>java FileChooseTest
Exception in thread "Basic L&F File Loading Thread" java.lang.NullPointerExcepti
at Source)
at Source)
at Sourc
at Source)
at javax.swing.filechooser.FileSystemView.isFileSystemRoot(Unknown Sourc
at javax.swing.filechooser.WindowsFileSystemView.isTraversable(Unknown S
at javax.swing.JFileChooser.isTraversable(Unknown Source)
at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(Unkno
wn Source)
at javax.swing.plaf.basic.BasicDirectoryModel$
n Source)

C:\Documents and Settings\titu\My Documents\java rev>

my prgram is

Please help......
Tom Reilly

Joined: Jun 01, 2010
Posts: 618
I was able to run this code on Linux with Sun Microsystems Inc. Java version 1.6.0_0 without error. The following topic in discusses a bug in some versions of the JRE that match the error:
I agree. Here's the link:
subject: Problem in JFileChooser
It's not a secret anymore!