aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem in JFileChooser" Watch "Problem in JFileChooser" New topic
Author

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
on
at sun.awt.shell.Win32ShellFolder2.pidlsEqual(Unknown Source)
at sun.awt.shell.Win32ShellFolder2.equals(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.isFileSystemRoot(Unknown Sourc
e)
at sun.awt.shell.ShellFolder.isFileSystemRoot(Unknown Source)
at javax.swing.filechooser.FileSystemView.isFileSystemRoot(Unknown Sourc
e)
at javax.swing.filechooser.WindowsFileSystemView.isTraversable(Unknown S
ource)
at javax.swing.JFileChooser.isTraversable(Unknown Source)
at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(Unkno
wn Source)
at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(Unknow
n Source)



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

my prgram is


Please help......
Tom Reilly
Rancher

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 forums.sun.com discusses a bug in some versions of the JRE that match the error: http://forums.sun.com/thread.jspa?threadID=5442336
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in JFileChooser