Java Reference
In-Depth Information
Access modifiers
Let's take a closer look at the access modifiers supported in JavaFX. Access modifiers allow
you to control the visibility of script-level and class-level members.
Access-modifier
Description
Location
default
The default (or script-only) is applied when no
modifier is specified. This means that the member is
accessible by other members in the same script or
module file. This applies to variables, functions, and
classes.
Script, module.
public
This member is visible from anywhere in the
application. The modifier can be applied to variables,
function, and classes.
Module, class.
public-read
This member is public but it is read-only. This modifier
applies to only variable members.
Module, class.
public-init
This member has public visibility. This modifier
applies to only variables. It indicates that the member
can be initialized in an object literal declaration.
Class.
protected
This member is visible to other code in the same
package or sub-classed code. Modifier applies to
variables and function members.
Script, module, class.
package
This members are visible to other code in the same
package. This applies to variables, functions, and
classes.
Script, module, class.
See also
F Declaring and using JavaFX classes
F Creating and using JavaFX functions
Creating your own custom node
Part of the fun in working with JavaFX is the ease with which you can create your own visual
components. As your needs outgrow the basic nodes that are available, you will find it
necessary to create new components that capture more complex interactivity behaviors and
functionalities. In this recipe, we will explore how to create customized graphical nodes that
can be used wherever you can attach a node to the scene graph.
Search WWH ::




Custom Search