APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.stage

public final Class DirectoryChooser

extends Object
Class Inheritance
Imports
com.sun.javafx.tk.Toolkit, java.io.File, javafx.beans.property.ObjectProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty

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

Field Summary

Modifier and TypeField and Description
private ObjectProperty<File>
initialDirectory

The initial directory for the displayed dialog.

private StringProperty
title

The title of the displayed dialog.

Constructor Summary

AccessConstructor and Description
public
DirectoryChooser()

Creates a DirectoryChooser.

Method Summary

Modifier and TypeMethod and Description
public final File
public final String
public final ObjectProperty<File>
public final void
public final void
setTitle(final String value)

public File

Returns:

the selected directory or null if no directory has been selected
showDialog
(final Window
the owner window of the displayed dialog
ownerWindow
)

Shows a new directory selection dialog.

public final StringProperty
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

initialDirectoryback to summary
private ObjectProperty<File> initialDirectory

The initial directory for the displayed dialog.

titleback to summary
private StringProperty title

The title of the displayed dialog.

Constructor Detail

DirectoryChooserback to summary
public DirectoryChooser()

Creates a DirectoryChooser.

Method Detail

getInitialDirectoryback to summary
public final File getInitialDirectory()
getTitleback to summary
public final String getTitle()
initialDirectoryPropertyback to summary
public final ObjectProperty<File> initialDirectoryProperty()
setInitialDirectoryback to summary
public final void setInitialDirectory(final File value)
setTitleback to summary
public final void setTitle(final String value)
showDialogback to summary
public File showDialog(final 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 or null 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:Window

the owner window of the displayed dialog

Returns:File

the selected directory or null if no directory has been selected

titlePropertyback to summary
public final StringProperty titleProperty()