JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

Profile: desktop, common

Overview

The JavaFX Stage class is the top level container for the FX script instantiation.

Example:


import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
Stage {
    title: "Welcome to JavaFX!"
    scene: Scene {
        content: [
            Text { content: "Hello World!" x:25 y:25 fill: Color.BLACK font: Font{ size: 32 } }
        ]
    }
}
 

produces the following on Mac OSX:

produces the following on Windows XP:

produces the following on Windows Vista:

Profile: common

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicextensionsStageExtension[]empty

The extensions that a Stage may have depending on the target profile of the script.

public-readfocusedBoolean

Whether or not this Stage is in focus or not.

publicfullScreenBooleanfalse

Specifies whether this Stage should be a full-screen, undecorated window.

Specifies whether this Stage should be a full-screen, undecorated window. Note that in some situations, it may not be possible for this stage to be made full-screen. Setting this variable to true will have no effect in those cases.

When set to true, it will attempt to enter full-screen exclusive mode. If the attempt is unsuccessful, a simulated full screen window will be used instead; the window will be maximized, made undecorated, and moved to the front. When set to true, the x, y, width, and height variables are overwritten with the actual position and size of the window; the iconified flag is forced to false; the resizable flag is forced to false; the style is forced to StageStyle.UNDECORATED; and opacity is forced to 1.0. Subsequent attempts to write to any of these variables will be ignored. If any of these variables are unidirectionally bound to an expression, full-screen mode will not be supported for this Stage.

When set to false, it will exit from full-screen exclusive mode (if set), and restore the previous window position, size, style, resizable flag, and opacity. The iconify flag will not be restored.

false

Profile: common

 
publicheightNumber

The height of this Stage.

The height of this Stage. Changing this attribute will shrink or heighten the height of the Stage. Note that if the fullScreen attribute is set any changes to height are ignored.

Profile: common

 
publiciconifiedBooleanfalse

Value that defines whether the Stage is iconified or not.

publiciconsImage[]empty

Defines the icon images to be used in the window decorations and when minimized.

Defines the icon images to be used in the window decorations and when minimized. The images should be different sizes of the same thing and the best size will be chosen, eg. 16x16, 32,32.

empty

Profile: common

 
publiconClosefunction():Void

This is the close action for the Stage.

publicopacityNumber1.0

Defines the opacity of the Stage as a value between 0.0 and 1.0.

Defines the opacity of the Stage as a value between 0.0 and 1.0. The opacity is reflected across the , its Decoration and its Scene content. On a JavaFX runtime platform that does not support opacity, assigning a value to this variable will have no visible difference. A Stage with 0% opacity is fully translucent.

1.0

Profile: common

 
publicresizableBooleantrue

Value that defines whether the Stage is resizable or not.

Value that defines whether the Stage is resizable or not. This attribute is ignored if the Stage is in full-screen mode.

true

Profile: common

 
publicsceneScenenull

The Scene to be rendered on this Stage.

public-initstyleStageStyleStageStyle.DECORATED

Defines the StageStyle of the Stage.

Defines the StageStyle of the Stage. For platforms that do not support StageStyle decoration setting this attribute has no effect.

StageStyle.DECORATED

Profile: common

 
publictitleStringempty string

Defines the title of the Stage.

Defines the title of the Stage. This value is only used if the Stage style is set to StageStyle.DECORATED.

empty string

Profile: common

 
publicvisibleBooleantrue

Whether or not this Stage is visible or not.

publicwidthNumber

The width of this Stage.

The width of this Stage. Changing this attribute will narrow or widen the width of the Stage. Note that if the fullScreen attribute is set any changes to width are ignored.

Profile: common

 
publicxNumber

The horizontal location of this Stage on the screen.

The horizontal location of this Stage on the screen. Changing this attribute will move the Stage horizontally. Note that if the fullScreen attribute is set any changes to x are ignored.

Profile: common

 
publicyNumber

The vertical location of this Stage on the screen.

The vertical location of this Stage on the screen. Changing this attribute will move the Stage vertically. Note that if the fullScreen attribute is set any changes to y are ignored.

Profile: common

 

Inherited Variables

Function Summary

public close() : Void

Close the Stage and trigger the onClose close action.

Close the Stage and trigger the onClose close action.

Closing a Stage will prevent it from being made visible again, it's resources are disposed and no longer available.

The close() function may only be called once on a Stage and any subsequent calls are ignored

.

Profile: common

 
public impl_setFocused(focused: Boolean) : Void
Parameters
focused
 
public toBack() : Void

Bring the Stage to the background.

Bring the Stage to the background. If the Stage is already in the background there is no visible difference. This action places this Stage at the bottom of the stacking order on platforms that support stacking.

Profile: common

 
public toFront() : Void

Bring the Stage to the foreground.

Bring the Stage to the foreground. If the Stage is already in the foreground there is no visible difference.

Profile: common

 

Inherited Functions




Spec-Zone.ru - all specs in one place