FileChooser

scalafx.stage.FileChooser
See theFileChooser companion object
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.

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);
}

Attributes

Companion
object
Graph
Supertypes
trait SFXDelegate[FileChooser]
class Object
trait Matchable
class Any

Members list

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.

Attributes

The initial directory for the displayed dialog.

The initial directory for the displayed dialog.

Attributes

def initialDirectory_=(v: File): Unit

The initial file name for the displayed dialog.

The initial file name for the displayed dialog.

Attributes

def selectedExtensionFilter: ObjectProperty[ExtensionFilter]

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.

Attributes

def showOpenDialog(ownerWindow: Window): File

Shows a new file open dialog.

Shows a new file open dialog.

Attributes

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.

Attributes

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.

Attributes

Returns

the selected file or null if no file has been selected

The title of the displayed dialog.

The title of the displayed dialog.

Attributes

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 parameters

ref

Object to be compared.

Attributes

Returns

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

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate
override def hashCode: Int

Attributes

Returns

The delegate hashcode

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate
override def toString: String

Attributes

Returns

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

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate

Concrete fields

override val delegate: FileChooser

JavaFX object to be wrapped.

JavaFX object to be wrapped.

Attributes