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

DirectoryChooser.setInitialDirectory(File) pays no attention to the parameter value.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      Description

      The following code should open the chooser dialog in "/Users/pf". Instead, it opens in whatever was last chosen.

          public File browse(String title, File folderToOpen) {
              DirectoryChooser chooser = new DirectoryChooser();

              log.debug("folderToOpen: {}", folderToOpen.getAbsolutePath());
              chooser.setInitialDirectory(folderToOpen);
              chooser.setTitle(title);

              return chooser.showDialog(this.getWindow());
          }

          browse("A title", "/Users/pf");

      For example, if I last chose "/Users/pf/Documents", that is the folder that will be shown in the dialog.

      This seems like a reversion of RT-23449 which was filed against JavaFX 2.2 and supposedly fixed for OS X.

      Note that I'm assuming "Lombard" is JFX 8.something. Anything that can be done to fix this Jira wrt the cryptic names of Lombard, etc., would be most helpful.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pchelko Petr Pchelko (Inactive)
              Reporter:
              pfurbachejfx Paul Furbacher (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: