Overview
The JavaFX Scene class is the root for all content in a
scene graph. The background of the scene is filled as specified by the
fill variable. The set of Nodes in the content sequence is
then rendered on the scene.
For example:
the code:
import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
Scene {
width: 250
height: 150
fill: LinearGradient {
endX: 0.0
stops: [ Stop { offset: 0.0 color: Color.LIGHTGRAY }
Stop { offset: 1.0 color: Color.GRAY } ]
}
content: [
Circle { centerX: 40 centerY: 50 radius: 25 fill: Color.GREEN }
Rectangle { x: 100 y: 25 width: 75 height: 50 fill: Color.BLUE }
]
}produces:

Profile: common
Variable Summary
| access | name | type | Can Read | Can Init | Can Write | Default Value | description |
|---|---|---|---|---|---|---|---|
| public | camera | Camera | ![]() | ![]() | ![]() | null |
Specifies the type of camera use for rendering this
Specifies the type of camera use for rendering this Note: this is a conditional feature. See ConditionalFeature.SCENE3D for more information. nullProfile: common conditional scene3d |
| public | content | Node[] | ![]() | ![]() | ![]() | empty |
The sequence of |
| public | cursor | Cursor | ![]() | ![]() | ![]() | null |
Defines the mouse cursor for this
Defines the mouse cursor for this Profile: common |
| public | fill | Paint | ![]() | ![]() | ![]() | WHITE |
Defines the background fill of this
Defines the background fill of this Profile: common |
| public-init | height | Number | ![]() | ![]() |
The height of this |
||
| public-read | stage | Stage | ![]() |
The |
|||
| public | stylesheets | String[] | ![]() | ![]() | ![]() |
A series string urls linking to the stylesheets to use with this scene's contents. |
|
| public-init | width | Number | ![]() | ![]() |
The width of this |
||
| public-read | x | Number | ![]() |
The horizontal location of this |
|||
| public-read | y | Number | ![]() |
The vertical location of this |
Inherited Variables
Script Function Summary
Function Summary
- public lookup(id: java.lang.String) : Node
-
Looks for any node within the scene's
contenthierarchy with the specified id.
Looks for any node within the scene's
contenthierarchy with the specified id. If more than one node has the specified id, this function returns one of them. Which node it returns in that case is unspecified. If no nodes are found with this id, then null is returned. Note that thelookupfunction will not descend into the children of aCustomNode. ACustomNodeprovides a means of encapsulation for objects whose details are not exposed to the application scene graph.-
Parameters
- id
- the id to look up
-
Returns
- Node
-
the
Nodein the scene with the specified id, ornullif no node with that id string is found.
Profile: common
