Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in JFileChooser

 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic