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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 8
    • javafx

      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.

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

              Created:
              Updated:
              Resolved:
              Imported: