package stage
- Alphabetic
- By Inheritance
- stage
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- class DirectoryChooser extends SFXDelegate[javafx.stage.DirectoryChooser]
- class FileChooser extends SFXDelegate[javafx.stage.FileChooser]
Provides support for standard platform file dialogs.
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); }
- sealed abstract class Modality extends SFXEnumDelegate[javafx.stage.Modality]
Wraps javafx.stage.Modality.
- class Popup extends PopupWindow with SFXDelegate[javafx.stage.Popup]
- abstract class PopupWindow extends Window with SFXDelegate[javafx.stage.PopupWindow]
- class Screen extends SFXDelegate[javafx.stage.Screen]
- class Stage extends Window with SFXDelegate[javafx.stage.Stage]
The primary stage for your application has to be created by wrapping the
JFXApp3.stage
object.The primary stage for your application has to be created by wrapping the
JFXApp3.stage
object.stage = new JFXApp3.PrimaryStage { // your definitions }
Any further stage would be simply instantiated by the no-arg constructor. - trait StageIncludes extends AnyRef
Contains implcit methods to convert from
javafx.stage
Classes/Traits to their ScalaFX counterparts. - sealed abstract class StageStyle extends SFXEnumDelegate[javafx.stage.StageStyle]
Wraps http://docs.oracle.com/javase/8/javafx/api/javafx/stage/StageStyle.html
- class Window extends EventHandlerDelegate2 with SFXDelegate[javafx.stage.Window] with EventTarget
- class WindowEvent extends Event with SFXDelegate[javafx.stage.WindowEvent]
Value Members
- object DirectoryChooser
- object FileChooser
- object Modality extends SFXEnumDelegateCompanion[javafx.stage.Modality, Modality]
Wrapper for javafx.stage.Modality
- object Popup
- object PopupWindow
- object Screen
- object Stage
- object StageIncludes extends StageIncludes
- object StageStyle extends SFXEnumDelegateCompanion[javafx.stage.StageStyle, StageStyle]
- object Window
- object WindowEvent
ScalaFX is a UI DSL written within the Scala Language that sits on top of JavaFX 2.x and and JavaFX 8. This means that every ScalaFX application is also a valid Scala application. By extension it supports full interoperability with Java and can run anywhere the Java Virtual Machine (JVM) and JavaFX 2.0 or JavaFX 8 are supported.
Package Structure
ScalaFX package structure corresponds to JavaFX package structure, for instance
scalafx.animation
corresponds tojavafx.animation
.Example Usage
A basic ScalaFX application is created creating an object that is an instance of
JFXApp3
. Following Java FX theatre metaphor, it contains astage
that contains ascene
. Astage
roughly corresponds to a window in a typical UI environment. Thescene
holds UI content presented to the user. In the example below, the content is a pane with a singlelabel
component.