- All Implemented Interfaces:
- Styleable,- EventTarget,- Skinnable
- Direct Known Subclasses:
- Accordion,- ButtonBar,- ChoiceBox,- ComboBoxBase,- HTMLEditor,- Labeled,- ListView,- MenuBar,- Pagination,- ProgressIndicator,- ScrollBar,- ScrollPane,- Separator,- Slider,- Spinner,- SplitPane,- TableView,- TabPane,- TextInputControl,- ToolBar,- TreeTableView,- TreeView
Additionally, controls support explicit skinning to make it easy to leverage the functionality of a control while customizing its appearance.
See specific Control subclasses for information on how to use individual types of controls.
 Most controls have their focusTraversable property set to true by default, however
 read-only controls such as Label and ProgressIndicator, and some
 controls that are containers ScrollPane and ToolBar do not.
 Consult individual control documentation for details.
- Since:
- JavaFX 2.0
- 
Property SummaryPropertiesTypePropertyDescriptionfinal ObjectProperty<ContextMenu>The ContextMenu to show for this control.final ObjectProperty<Skin<?>>Skin is responsible for rendering thisControl.final ObjectProperty<Tooltip>The ToolTip for this control.Properties declared in class javafx.scene.layout.Regionbackground, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties declared in class javafx.scene.ParentneedsLayoutProperties declared in class javafx.scene.NodeaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
- 
Field SummaryFields declared in class javafx.scene.layout.RegionUSE_COMPUTED_SIZE, USE_PREF_SIZEFields declared in class javafx.scene.NodeBASELINE_OFFSET_SAME_AS_HEIGHT
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected doublecomputeMaxHeight(double width) Computes the maximum allowable height of the Control, based on the provided width.protected doublecomputeMaxWidth(double height) Computes the maximum allowable width of the Control, based on the provided height.protected doublecomputeMinHeight(double width) Computes the minimum allowable height of the Control, based on the provided width.protected doublecomputeMinWidth(double height) Computes the minimum allowable width of the Control, based on the provided height.final ObjectProperty<ContextMenu>The ContextMenu to show for this control.protected Skin<?>Create a new instance of the default skin for this control.static List<CssMetaData<? extends Styleable,?>> Gets theCssMetaDataassociated with this class, which may include theCssMetaDataof its superclasses.final ContextMenuGets the value of thecontextMenuproperty.protected List<CssMetaData<? extends Styleable,?>> Gets the unmodifiable list of the control's CSS-styleable properties.final List<CssMetaData<? extends Styleable,?>> This method returns aListcontaining allCssMetaDatafor both this Control (returned fromgetControlCssMetaData()and itsSkin, assuming theskin propertyis aSkinBase.protected BooleanReturns the initial focus traversable state of this control, for use by the JavaFX CSS engine to correctly set its initial value.final Skin<?>getSkin()Gets the value of theskinproperty.final TooltipGets the value of thetooltipproperty.booleanReturnstruesince all Controls are resizable.final voidsetContextMenu(ContextMenu value) Sets the value of thecontextMenuproperty.final voidSets the value of theskinproperty.final voidsetTooltip(Tooltip value) Sets the value of thetooltipproperty.final ObjectProperty<Skin<?>>Skin is responsible for rendering thisControl.final ObjectProperty<Tooltip>The ToolTip for this control.Methods declared in class javafx.scene.layout.RegionbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computePrefHeight, computePrefWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods declared in class javafx.scene.ParentgetBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods declared in class javafx.scene.NodeaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods declared in interface javafx.css.StyleablegetStyleableNode
- 
Property Details- 
skinSkin is responsible for rendering thisControl. From the perspective of theControl, theSkinis a black box. It listens and responds to changes in state in aControl.There is a one-to-one relationship between a Controland itsSkin. EverySkinmaintains a back reference to theControlvia theSkin.getSkinnable()method.To ensure a one-to-one relationship between a Controland itsSkin, skins which were not created for this control are rejected with anIllegalArgumentException. Then,Skin.dispose()is called on the old skin, disconnecting it from the correspondingControl. And finally,Skin.install()is invoked to complete the process. Only inside ofSkin.install()shouldSkinimplementations set/overwrite properties of theirControl(though some operations like adding/removing a listener can still be done in theSkinconstructor).A skin may be null. - Specified by:
- skinPropertyin interface- Skinnable
- Returns:
- the skin property for this Skinnable
- See Also:
 
- 
tooltipThe ToolTip for this control.- See Also:
 
- 
contextMenuThe ContextMenu to show for this control.
 
- 
- 
Constructor Details- 
Controlprotected Control()Create a new Control.
 
- 
- 
Method Details- 
skinPropertySkin is responsible for rendering thisControl. From the perspective of theControl, theSkinis a black box. It listens and responds to changes in state in aControl.There is a one-to-one relationship between a Controland itsSkin. EverySkinmaintains a back reference to theControlvia theSkin.getSkinnable()method.To ensure a one-to-one relationship between a Controland itsSkin, skins which were not created for this control are rejected with anIllegalArgumentException. Then,Skin.dispose()is called on the old skin, disconnecting it from the correspondingControl. And finally,Skin.install()is invoked to complete the process. Only inside ofSkin.install()shouldSkinimplementations set/overwrite properties of theirControl(though some operations like adding/removing a listener can still be done in theSkinconstructor).A skin may be null. - Specified by:
- skinPropertyin interface- Skinnable
- Returns:
- the skin property for this control
- See Also:
 
- 
setSkinSets the value of theskinproperty.- Specified by:
- setSkinin interface- Skinnable
- Property description:
- Skin is responsible for rendering this Control. From the perspective of theControl, theSkinis a black box. It listens and responds to changes in state in aControl.There is a one-to-one relationship between a Controland itsSkin. EverySkinmaintains a back reference to theControlvia theSkin.getSkinnable()method.To ensure a one-to-one relationship between a Controland itsSkin, skins which were not created for this control are rejected with anIllegalArgumentException. Then,Skin.dispose()is called on the old skin, disconnecting it from the correspondingControl. And finally,Skin.install()is invoked to complete the process. Only inside ofSkin.install()shouldSkinimplementations set/overwrite properties of theirControl(though some operations like adding/removing a listener can still be done in theSkinconstructor).A skin may be null. 
- Parameters:
- value- the value for the- skinproperty
- See Also:
 
- 
getSkinGets the value of theskinproperty.- Specified by:
- getSkinin interface- Skinnable
- Property description:
- Skin is responsible for rendering this Control. From the perspective of theControl, theSkinis a black box. It listens and responds to changes in state in aControl.There is a one-to-one relationship between a Controland itsSkin. EverySkinmaintains a back reference to theControlvia theSkin.getSkinnable()method.To ensure a one-to-one relationship between a Controland itsSkin, skins which were not created for this control are rejected with anIllegalArgumentException. Then,Skin.dispose()is called on the old skin, disconnecting it from the correspondingControl. And finally,Skin.install()is invoked to complete the process. Only inside ofSkin.install()shouldSkinimplementations set/overwrite properties of theirControl(though some operations like adding/removing a listener can still be done in theSkinconstructor).A skin may be null. 
- Returns:
- the value of the skinproperty
- See Also:
 
- 
tooltipPropertyThe ToolTip for this control.- Returns:
- the tool tip for this control
- See Also:
 
- 
setTooltipSets the value of thetooltipproperty.- Property description:
- The ToolTip for this control.
- Parameters:
- value- the value for the- tooltipproperty
- See Also:
 
- 
getTooltipGets the value of thetooltipproperty.- Property description:
- The ToolTip for this control.
- Returns:
- the value of the tooltipproperty
- See Also:
 
- 
contextMenuPropertyThe ContextMenu to show for this control.- Returns:
- the contextMenuproperty
- See Also:
 
- 
setContextMenuSets the value of thecontextMenuproperty.- Property description:
- The ContextMenu to show for this control.
- Parameters:
- value- the value for the- contextMenuproperty
- See Also:
 
- 
getContextMenuGets the value of thecontextMenuproperty.- Property description:
- The ContextMenu to show for this control.
- Returns:
- the value of the contextMenuproperty
- See Also:
 
- 
isResizablepublic boolean isResizable()Returnstruesince all Controls are resizable.- Overrides:
- isResizablein class- Region
- Returns:
- whether this node can be resized by its parent during layout
- See Also:
 
- 
computeMinWidthprotected double computeMinWidth(double height) Computes the minimum allowable width of the Control, based on the provided height. The minimum width is not calculated within the Control, instead the calculation is delegated to theNode.minWidth(double)method of theSkin. If the Skin is null, the returned value is 0.- Overrides:
- computeMinWidthin class- Region
- Parameters:
- height- The height of the Control, in case this value might dictate the minimum width.
- Returns:
- A double representing the minimum width of this control.
 
- 
computeMinHeightprotected double computeMinHeight(double width) Computes the minimum allowable height of the Control, based on the provided width. The minimum height is not calculated within the Control, instead the calculation is delegated to theNode.minHeight(double)method of theSkin. If the Skin is null, the returned value is 0.- Overrides:
- computeMinHeightin class- Region
- Parameters:
- width- The width of the Control, in case this value might dictate the minimum height.
- Returns:
- A double representing the minimum height of this control.
 
- 
computeMaxWidthprotected double computeMaxWidth(double height) Computes the maximum allowable width of the Control, based on the provided height. The maximum width is not calculated within the Control, instead the calculation is delegated to theNode.maxWidth(double)method of theSkin. If the Skin is null, the returned value is 0.- Overrides:
- computeMaxWidthin class- Region
- Parameters:
- height- The height of the Control, in case this value might dictate the maximum width.
- Returns:
- A double representing the maximum width of this control.
 
- 
computeMaxHeightprotected double computeMaxHeight(double width) Computes the maximum allowable height of the Control, based on the provided width. The maximum height is not calculated within the Control, instead the calculation is delegated to theNode.maxHeight(double)method of theSkin. If the Skin is null, the returned value is 0.- Overrides:
- computeMaxHeightin class- Region
- Parameters:
- width- The width of the Control, in case this value might dictate the maximum height.
- Returns:
- A double representing the maximum height of this control.
 
- 
createDefaultSkinCreate a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS-fx-skinor set explicitly in a sub-class withsetSkin(...).- Returns:
- new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.
- Since:
- JavaFX 8.0
 
- 
getClassCssMetaDataGets theCssMetaDataassociated with this class, which may include theCssMetaDataof its superclasses.- Returns:
- the CssMetaData
- Since:
- JavaFX 8.0
 
- 
getCssMetaDataThis method returns aListcontaining allCssMetaDatafor both this Control (returned fromgetControlCssMetaData()and itsSkin, assuming theskin propertyis aSkinBase.Developers who wish to provide custom CssMetaData are therefore encouraged to override getControlCssMetaData()orSkinBase.getCssMetaData(), depending on where the CssMetaData resides.- Specified by:
- getCssMetaDatain interface- Styleable
- Overrides:
- getCssMetaDatain class- Region
- Returns:
- The CssMetaData associated with this node, which may include the CssMetaData of its superclasses.
- Since:
- JavaFX 8.0
 
- 
getControlCssMetaDataGets the unmodifiable list of the control's CSS-styleable properties.- Returns:
- the unmodifiable list of the control's CSS-styleable properties
- Since:
- JavaFX 8.0
 
- 
getInitialFocusTraversableReturns the initial focus traversable state of this control, for use by the JavaFX CSS engine to correctly set its initial value. By default all UI controls are focus traversable, so this method is overridden in Control to set the initial traversable state to true.- Overrides:
- getInitialFocusTraversablein class- Node
- Returns:
- the initial focus traversable state of this control
- Since:
- 9
 
 
-