java.lang.Object
javafx.stage.DirectoryChooser
Provides support for standard directory chooser dialogs. These dialogs have
look and feel of the platform UI components which is independent of JavaFX.
On some platforms where file access may be restricted or not part of the user
model (for example, on some mobile or embedded devices), opening a directory
dialog may always result in a no-op (that is, null file being returned).
- Since:
- JavaFX 2.1
-
Property Summary
TypePropertyDescriptionfinal ObjectProperty
<File> The initial directory for the displayed dialog.final StringProperty
The title of the displayed dialog. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal File
Gets the value of theinitialDirectory
property.final String
getTitle()
Gets the value of thetitle
property.final ObjectProperty
<File> The initial directory for the displayed dialog.final void
setInitialDirectory
(File value) Sets the value of theinitialDirectory
property.final void
Sets the value of thetitle
property.showDialog
(Window ownerWindow) Shows a new directory selection dialog.final StringProperty
The title of the displayed dialog.
-
Property Details
-
title
The title of the displayed dialog.- See Also:
-
initialDirectory
The initial directory for the displayed dialog.- See Also:
-
-
Constructor Details
-
DirectoryChooser
public DirectoryChooser()Creates aDirectoryChooser
.
-
-
Method Details
-
setTitle
Sets the value of thetitle
property.- Property description:
- The title of the displayed dialog.
- Parameters:
value
- the value for thetitle
property- See Also:
-
getTitle
Gets the value of thetitle
property.- Property description:
- The title of the displayed dialog.
- Returns:
- the value of the
title
property - See Also:
-
titleProperty
The title of the displayed dialog.- Returns:
- the
title
property - See Also:
-
setInitialDirectory
Sets the value of theinitialDirectory
property.- Property description:
- The initial directory for the displayed dialog.
- Parameters:
value
- the value for theinitialDirectory
property- See Also:
-
getInitialDirectory
Gets the value of theinitialDirectory
property.- Property description:
- The initial directory for the displayed dialog.
- Returns:
- the value of the
initialDirectory
property - See Also:
-
initialDirectoryProperty
The initial directory for the displayed dialog.- Returns:
- the
initialDirectory
property - See Also:
-
showDialog
Shows a new directory selection dialog. The method doesn't return until the displayed dialog is dismissed. The return value specifies the directory chosen by the user ornull
if no selection has been made. If the owner window for the directory selection dialog is set, input to all windows in the dialog's owner chain is blocked while the dialog is being shown.- Parameters:
ownerWindow
- the owner window of the displayed dialog- Returns:
- the selected directory or
null
if no directory has been selected
-