Class DirectoryChooser
- javafx.stage.DirectoryChooser
public final class DirectoryChooser extends Object
Since:
JavaFX 2.1
-
Property Summary
All MethodsInstance MethodsConcrete Methods Type Property and Description ObjectProperty<File>initialDirectoryThe initial directory for the displayed dialog.StringPropertytitleThe title of the displayed dialog.
-
Constructor Summary
Constructors Constructor and Description DirectoryChooser()
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description FilegetInitialDirectory()Gets the value of the property initialDirectory.StringgetTitle()Gets the value of the property title.ObjectProperty<File>initialDirectoryProperty()The initial directory for the displayed dialog.voidsetInitialDirectory(File value)Sets the value of the property initialDirectory.voidsetTitle(String value)Sets the value of the property title.FileshowDialog(Window ownerWindow)Shows a new directory selection dialog.StringPropertytitleProperty()The title of the displayed dialog.
-
Property Detail
-
title
public final StringProperty titleProperty
The title of the displayed dialog.See Also:
-
initialDirectory
public final ObjectProperty<File> initialDirectoryProperty
The initial directory for the displayed dialog.See Also:
-
-
Constructor Detail
-
DirectoryChooser
public DirectoryChooser()
-
-
Method Detail
-
setTitle
public final void setTitle(String value)
Sets the value of the property title.Property description:
The title of the displayed dialog.
-
getTitle
public final String getTitle()
Gets the value of the property title.Property description:
The title of the displayed dialog.
-
titleProperty
public final StringProperty titleProperty()
The title of the displayed dialog.See Also:
-
setInitialDirectory
public final void setInitialDirectory(File value)
Sets the value of the property initialDirectory.Property description:
The initial directory for the displayed dialog.
-
getInitialDirectory
public final File getInitialDirectory()
Gets the value of the property initialDirectory.Property description:
The initial directory for the displayed dialog.
-
initialDirectoryProperty
public final ObjectProperty<File> initialDirectoryProperty()
The initial directory for the displayed dialog.See Also:
-
showDialog
public File showDialog(Window ownerWindow)
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 ornullif 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 dialogReturns:
the selected directory or
nullif no directory has been selected
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.