diff --git a/src/main/java/tornadofx/Dialogs.kt b/src/main/java/tornadofx/Dialogs.kt index 3baf557ed..8337def8a 100644 --- a/src/main/java/tornadofx/Dialogs.kt +++ b/src/main/java/tornadofx/Dialogs.kt @@ -70,10 +70,11 @@ enum class FileChooserMode { None, Single, Multi, Save } * * If the user cancels, the returnedfile list will be empty. */ -fun chooseFile(title: String? = null, filters: Array, mode: FileChooserMode = Single, owner: Window? = null, op: FileChooser.() -> Unit = {}): List { +fun chooseFile(title: String? = null, filters: Array, initialDirectory: File? = null, mode: FileChooserMode = Single, owner: Window? = null, op: FileChooser.() -> Unit = {}): List { val chooser = FileChooser() if (title != null) chooser.title = title chooser.extensionFilters.addAll(filters) + chooser.initialDirectory = initialDirectory op(chooser) return when (mode) { Single -> {