java filecheeser error on UNC path

Posted on 2007-07-31
Last Modified: 2013-11-23
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();
      int retval = fc.showOpenDialog(frame);

      if(retval == JFileChooser.APPROVE_OPTION){
            String path = fc.getCurrentDirectory().toString();
      }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 javax.swing.filechooser.FileSystemView.getFiles(
      at javax.swing.plaf.basic.BasicDirectoryModel$
Question by:karanba
    LVL 7

    Expert Comment

    Is \\comp\share already connected - JFileChooser cannot show an authentication dialog.

    What version of Java are you on, and what platform?

    Author Comment

    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.
    LVL 20

    Accepted Solution

    This is a bug in your version of JDK when using DIRECTORIES_ONLY mode. See here:
    Also,  4356160  , 5086831  

    The first link contains a workaround if you cannot upgrade to JDK 6.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now