java filecheeser error on UNC path

Hi the following code get exception when try to use a network share path like \\computer_name\share_name. For local directory no problem. And there is no permission problem on share...
-------------------------------------------------------------------------------------
      JFileChooser fc = new JFileChooser();
      fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
      fc.setAcceptAllFileFilterUsed(false);
      int retval = fc.showOpenDialog(frame);

      if(retval == JFileChooser.APPROVE_OPTION){
            String path = fc.getCurrentDirectory().toString();
            System.out.println(path);
      }else {
            System.out.println("No Selection ");
      }
-----------------------------------------------------------
Exception in thread "Basic L&F File Loading Thread" java.lang.InternalError: Unable to bind \\computer_name\share_name to parent
      at sun.awt.shell.Win32ShellFolder2.getIShellFolder(Win32ShellFolder2.java:322)
      at sun.awt.shell.Win32ShellFolder2.listFiles(Win32ShellFolder2.java:538)
      at javax.swing.filechooser.FileSystemView.getFiles(FileSystemView.java:422)
      at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(BasicDirectoryModel.java:195)
 
___________________________________________
karanbaAsked:
Who is Participating?
 
gatorvipConnect With a Mentor Commented:
This is a bug in your version of JDK when using DIRECTORIES_ONLY mode. See here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5102604
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6180936
Also,  4356160  , 5086831  

The first link contains a workaround if you cannot upgrade to JDK 6.
0
 
ravs120499Commented:
Is \\comp\share already connected - JFileChooser cannot show an authentication dialog.

What version of Java are you on, and what platform?
0
 
karanbaAuthor Commented:
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

On windows xP machine

\\comp\share  is not connected, there is no need authenticaiton its public to everyone.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.