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 ofRT-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.
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
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.
- duplicates
-
JDK-8123096 Mac: DirectoryChooser not modal anymore
-
- Closed
-
- relates to
-
JDK-8088287 Mac: Add support for title to folder chooser
-
- Open
-