FileChooser

class FileChooser(val delegate: FileChooser) extends SFXDelegate[FileChooser]

Provides support for standard platform file dialogs. These dialogs have look and feel of the platform UI components which is independent of JavaFX.

Provides support for standard platform file dialogs. These dialogs have look and feel of the platform UI components which is independent of JavaFX.

Example:

import scalafx.Includes._
import scalafx.stage.FileChooser
import scalafx.stage.FileChooser.ExtensionFilter

...

val fileChooser = new FileChooser {
title = "Open Resource File"
extensionFilters ++= Seq(
  new ExtensionFilter("Text Files", "*.txt"),
  new ExtensionFilter("Image Files", Seq("*.png", "*.jpg", "*.gif")),
  new ExtensionFilter("Audio Files", Seq("*.wav", "*.mp3", "*.aac")),
  new ExtensionFilter("All Files", "*.*")
)
}
val selectedFile = fileChooser.showOpenDialog(stage)
if (selectedFile != null) {
stage.display(selectedFile);
}
Companion
object
trait SFXDelegate[FileChooser]
class Object
trait Matchable
class Any

Value members

Concrete methods

def extensionFilters: ObservableList[ExtensionFilter]

Gets the extension filters used in the displayed file dialog.

Gets the extension filters used in the displayed file dialog.

The initial directory for the displayed dialog.

The initial directory for the displayed dialog.

def initialDirectory_=(v: File): Unit

The initial file name for the displayed dialog.

The initial file name for the displayed dialog.

def initialFileName_=(v: String): Unit

This property is used to pre-select the extension filter for the next displayed dialog and to read the user-selected extension filter from the dismissed dialog.

This property is used to pre-select the extension filter for the next displayed dialog and to read the user-selected extension filter from the dismissed dialog.

def showOpenDialog(ownerWindow: Window): File

Shows a new file open dialog.

Shows a new file open dialog.

Returns

the selected file or null if no file has been selected

def showOpenMultipleDialog(ownerWindow: Window): Seq[File]

Shows a new file open dialog in which multiple files can be selected.

Shows a new file open dialog in which multiple files can be selected.

Returns

the selected files or null if no file has been selected

def showSaveDialog(ownerWindow: Window): File

Shows a new file save dialog.

Shows a new file save dialog.

Returns

the selected file or null if no file has been selected

The title of the displayed dialog.

The title of the displayed dialog.

def title_=(v: String): Unit

Inherited methods

override def equals(ref: Any): Boolean

Verifies if a object is equals to this delegate.

Verifies if a object is equals to this delegate.

Value Params
ref

Object to be compared.

Returns

if the other object is equals to this delegate or not.

Definition Classes
Inherited from
SFXDelegate
override def hashCode: Int
Returns

The delegate hashcode

Definition Classes
Inherited from
SFXDelegate
override def toString: String
Returns

Returns the original delegate's toString() adding a [SFX] prefix.

Definition Classes
Inherited from
SFXDelegate

Concrete fields

override val delegate: FileChooser