package application
- Alphabetic
- By Inheritance
- application
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait ApplicationIncludes extends AnyRef
Contains implicit methods to convert from
javafx.application
Classes to their ScalaFX counterparts. - sealed abstract class ConditionalFeature extends SFXEnumDelegate[javafx.application.ConditionalFeature]
- class HostServices extends SFXDelegate[javafx.application.HostServices]
This class provides HostServices for an Application.
This class provides HostServices for an Application. This includes methods to get the code base and document base for an Application, show a web page in a browser, and communicate with the enclosing web page using JavaScript if the Application is running in a browser.
Wraps a JavaFX HostServices.
- trait JFXApp3 extends AnyRef
ScalaFX applications can extend JFXApp3 to create properly initialized JavaFX applications.
ScalaFX applications can extend JFXApp3 to create properly initialized JavaFX applications.
On the back end
JFXApp3
first calls javafx.application.Application.launch then executes body of its constructor when javafx.application.Application.start(primaryStage:Stage) is called. Here is an example use:object SimpleScalaFXApp extends JFXApp3 { override def start() : Unit = { stage = new PrimaryStage { title = "Simple ScalaFX App" scene = new Scene { root = new StackPane { padding = Insets(20) content = new Rectangle { width = 200 height = 200 fill = Color.DEEPSKYBLUE } } } } } }
Deprecated Type Members
- trait JFXApp extends DelayedInit
ScalaFX applications can extend JFXApp to create properly initialized JavaFX applications.
ScalaFX applications can extend JFXApp to create properly initialized JavaFX applications.
On the back end
JFXApp
first calls javafx.application.Application.launch then executes body of its constructor when javafx.application.Application.start(primaryStage:Stage) is called. Here is an example use:object SimpleScalaFXApp extends JFXApp { stage = new PrimaryStage { title = "Simple ScalaFX App" scene = new Scene { root = new StackPane { padding = Insets(20) content = new Rectangle { width = 200 height = 200 fill = Color.DEEPSKYBLUE } } } } }
- Annotations
- @deprecated
- Deprecated
(Since version 16.0.0-R23)
JFXApp
depends onDelayedInit
that is deprecated since Scala 2.11.0 and no longer works in Scala 3. UseJFXApp3
instead.
Value Members
- object ApplicationIncludes extends ApplicationIncludes
- object ConditionalFeature extends SFXEnumDelegateCompanion[javafx.application.ConditionalFeature, ConditionalFeature]
Wrapper for javafx.application.ConditionalFeature
- object HostServices
- object JFXApp
- object JFXApp3
- object Platform
Application platform support, wrapper for javafx.application.Platform.
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
JFXApp
. 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.