Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6651762

JFileChooser is unable to show long file names

XMLWordPrintable

    • x86, sparc
    • solaris_2.5.1, windows_xp

      OPERATING SYSTEM(S):
      --------------------
      Windows XP

      FULL JDK VERSION(S):
      -------------------
      java version "1.6.0_04"
      Java(TM) SE Runtime Environment (build 1.6.0_04-b07)
      Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)

      DESCRIPTION:
      ------------

      JFilechooser is not showing the file name correctly if it's path length is more than 255. Instead, it is showing as "ShellFolder" in Java L&F and Motif L&F. Problem is not seen with Native L&F.

      Reproduction Instructions:

      1. Run the following java program to create folders with longer names.

      import java.io.File;
      import java.io.IOException;

      public class createFile {
      public static void main(String args[]) throws IOException{
      File f = new File("C:\\tmp\\1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890\\1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890");

      System.out.println(f.mkdirs());
      }
      }


      2. Run SwingSet2.jar
      3. Go to "FileChooser" demo.
      4. Click on "Show Plain JFileChooser"
      5. Select "C" drive & then select "tmp" then select the folder with
         long name created by above program
      6. Double click the above folder to open it.

      Observed result:
      Folder present inside the above said folder will be displayed as "ShellFolder".

      Expected result:
      Instead of "ShellFolder", its original name should be displayed (i.e 1234... etc.) as it is being displayed in Native L&F.

            Unassigned Unassigned
            rupashka Pavel Porvatov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: