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

JFileChooser doesn't allow creating more than 99 folders with default name

    XMLWordPrintable

    Details

    • Subcomponent:
    • Understanding:
      Fix Understood
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      JFileChooser doesn't allow creating more than 99 folders with default naming convention used.
      Platform: XP, Solaris 5.8
      L&F: Windows, Metal.
      1) Open SwingSet2
      2) Change L&F to Windows.
      3) Go to file chooser demo.
      4) Create folders so that you have 99 folders in that same directory with the default name generated by FileChooser i.e "New Folder" to "New Folder (99)"
      5) Now try creating one more folder in the same directory, And JFileChooser will throw error saying error creating "New Folder (99)".
      6) Now go in native file chooser and try creating one more folder in the
         same directory, And it will allow you to create a new folder with default
         name "New Folder (100)".

      The reason of this problem seems to be in method

      javax.swing.filechooser.FileSystemView$UnixFileSystemView::createNewFolder(File containingDir)

      javax.swing.filechooser.FileSystemView$WindowsFileSystemView::createNewFolder(File containingDir)

      Where for generatin folder names it checks on condition of i < 100
      So if there is already 99 folders generated by default name than it doesnt work.

      Note:
      The above problems can be reproduced on both XP and Solaris
      In XP we can use both Metal or Windows L&F to reproduce.
      In solaris it is reproducible in Metal L&F.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            hsinghsunw Hemant Singh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: