Class ScrollPane
- All Implemented Interfaces:
-
Styleable,EventTarget,Skinnable
@DefaultProperty("content") public class ScrollPane extends Control The ScrollPane allows the application to set the current, minimum, and maximum values for positioning the contents in the horizontal and vertical directions. These values are mapped proportionally onto the layoutBounds of the contained node.
ScrollPane layout calculations are based on the layoutBounds rather than the boundsInParent (visual bounds) of the scroll node. If an application wants the scrolling to be based on the visual bounds of the node (for scaled content etc.), it needs to wrap the scroll node in a Group.
ScrollPane sets focusTraversable to false.
ScrollPane only acts on key presses when it has the focus (Node.isFocused() returns true) and won't respond to key events that bubble up from a focused child control.
This example creates a ScrollPane, which contains a Rectangle:
Rectangle rect = new Rectangle(200, 200, Color.RED);
ScrollPane s1 = new ScrollPane();
s1.setPrefSize(120, 120);
s1.setContent(rect); - Since:
- JavaFX 2.0
Nested Class Summary
| Modifier and Type | Class | Description |
|---|---|---|
static enum |
ScrollPane.ScrollBarPolicy |
An enumeration denoting the policy to be used by a scrollable Control in deciding whether to show a scroll bar. |
Property Summary
| Type | Property | Description |
|---|---|---|
final ObjectProperty |
content |
The node used as the content of this ScrollPane. |
final BooleanProperty |
fitToHeight |
If true and if the contained node is a Resizable, then the node will be kept resized to match the height of the ScrollPane's viewport. |
final BooleanProperty |
fitToWidth |
If true and if the contained node is a Resizable, then the node will be kept resized to match the width of the ScrollPane's viewport. |
final ObjectProperty |
hbarPolicy |
Specifies the policy for showing the horizontal scroll bar. |
final DoubleProperty |
hmax |
The maximum allowable hvalue for this ScrollPane. |
final DoubleProperty |
hmin |
The minimum allowable hvalue for this ScrollPane. |
final DoubleProperty |
hvalue |
The current horizontal scroll position of the ScrollPane. |
final DoubleProperty |
minViewportHeight |
Specify the minimum height of the ScrollPane Viewport. |
final DoubleProperty |
minViewportWidth |
Specify the minimum width of the ScrollPane Viewport. |
final BooleanProperty |
pannable |
Specifies whether the user should be able to pan the viewport by using the mouse. |
final DoubleProperty |
prefViewportHeight |
Specify the preferred height of the ScrollPane Viewport. |
final DoubleProperty |
prefViewportWidth |
Specify the preferred width of the ScrollPane Viewport. |
final ObjectProperty |
vbarPolicy |
Specifies the policy for showing the vertical scroll bar. |
final ObjectProperty |
viewportBounds |
The actual Bounds of the ScrollPane Viewport. |
final DoubleProperty |
vmax |
The maximum allowable vvalue for this ScrollPane. |
final DoubleProperty |
vmin |
The minimum allowable vvalue for this ScrollPane. |
final DoubleProperty |
vvalue |
The current vertical scroll position of the ScrollPane. |
Properties declared in class javafx.scene.control.Control
contextMenu, skin, tooltip
Properties declared in class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties declared in class javafx.scene.Parent
needsLayout
Properties declared in class javafx.scene.Node
accessibleHelp, 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 Summary
Fields declared in class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
Fields declared in class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
Constructor Summary
| Constructor | Description |
|---|---|
ScrollPane() |
Creates a new ScrollPane. |
ScrollPane |
Creates a new ScrollPane. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
final ObjectProperty |
contentProperty() |
The node used as the content of this ScrollPane. |
final BooleanProperty |
fitToHeightProperty() |
If true and if the contained node is a Resizable, then the node will be kept resized to match the height of the ScrollPane's viewport. |
final BooleanProperty |
fitToWidthProperty() |
If true and if the contained node is a Resizable, then the node will be kept resized to match the width of the ScrollPane's viewport. |
static List |
getClassCssMetaData() |
Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses. |
final Node |
getContent() |
Gets the value of the content property. |
List |
getControlCssMetaData() |
Gets the unmodifiable list of the control's CSS-styleable properties. |
final ScrollPane.ScrollBarPolicy |
getHbarPolicy() |
Gets the value of the hbarPolicy property. |
final double |
getHmax() |
Gets the value of the hmax property. |
final double |
getHmin() |
Gets the value of the hmin property. |
final double |
getHvalue() |
Gets the value of the hvalue property. |
protected Boolean |
getInitialFocusTraversable() |
Returns the initial focus traversable state of this control, for use by the JavaFX CSS engine to correctly set its initial value. |
final double |
getMinViewportHeight() |
Gets the value of the minViewportHeight property. |
final double |
getMinViewportWidth() |
Gets the value of the minViewportWidth property. |
final double |
getPrefViewportHeight() |
Gets the value of the prefViewportHeight property. |
final double |
getPrefViewportWidth() |
Gets the value of the prefViewportWidth property. |
final ScrollPane.ScrollBarPolicy |
getVbarPolicy() |
Gets the value of the vbarPolicy property. |
final Bounds |
getViewportBounds() |
Gets the value of the viewportBounds property. |
final double |
getVmax() |
Gets the value of the vmax property. |
final double |
getVmin() |
Gets the value of the vmin property. |
final double |
getVvalue() |
Gets the value of the vvalue property. |
final ObjectProperty |
hbarPolicyProperty() |
Specifies the policy for showing the horizontal scroll bar. |
final DoubleProperty |
hmaxProperty() |
The maximum allowable hvalue for this ScrollPane. |
final DoubleProperty |
hminProperty() |
The minimum allowable hvalue for this ScrollPane. |
final DoubleProperty |
hvalueProperty() |
The current horizontal scroll position of the ScrollPane. |
final boolean |
isFitToHeight() |
Gets the value of the fitToHeight property. |
final boolean |
isFitToWidth() |
Gets the value of the fitToWidth property. |
final boolean |
isPannable() |
Gets the value of the pannable property. |
final DoubleProperty |
minViewportHeightProperty() |
Specify the minimum height of the ScrollPane Viewport. |
final DoubleProperty |
minViewportWidthProperty() |
Specify the minimum width of the ScrollPane Viewport. |
final BooleanProperty |
pannableProperty() |
Specifies whether the user should be able to pan the viewport by using the mouse. |
final DoubleProperty |
prefViewportHeightProperty() |
Specify the preferred height of the ScrollPane Viewport. |
final DoubleProperty |
prefViewportWidthProperty() |
Specify the preferred width of the ScrollPane Viewport. |
final void |
setContent |
Sets the value of the content property. |
final void |
setFitToHeight |
Sets the value of the fitToHeight property. |
final void |
setFitToWidth |
Sets the value of the fitToWidth property. |
final void |
setHbarPolicy |
Sets the value of the hbarPolicy property. |
final void |
setHmax |
Sets the value of the hmax property. |
final void |
setHmin |
Sets the value of the hmin property. |
final void |
setHvalue |
Sets the value of the hvalue property. |
final void |
setMinViewportHeight |
Sets the value of the minViewportHeight property. |
final void |
setMinViewportWidth |
Sets the value of the minViewportWidth property. |
final void |
setPannable |
Sets the value of the pannable property. |
final void |
setPrefViewportHeight |
Sets the value of the prefViewportHeight property. |
final void |
setPrefViewportWidth |
Sets the value of the prefViewportWidth property. |
final void |
setVbarPolicy |
Sets the value of the vbarPolicy property. |
final void |
setViewportBounds |
Sets the value of the viewportBounds property. |
final void |
setVmax |
Sets the value of the vmax property. |
final void |
setVmin |
Sets the value of the vmin property. |
final void |
setVvalue |
Sets the value of the vvalue property. |
final ObjectProperty |
vbarPolicyProperty() |
Specifies the policy for showing the vertical scroll bar. |
final ObjectProperty |
viewportBoundsProperty() |
The actual Bounds of the ScrollPane Viewport. |
final DoubleProperty |
vmaxProperty() |
The maximum allowable vvalue for this ScrollPane. |
final DoubleProperty |
vminProperty() |
The minimum allowable vvalue for this ScrollPane. |
final DoubleProperty |
vvalueProperty() |
The current vertical scroll position of the ScrollPane. |
Methods declared in class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, contextMenuProperty, createDefaultSkin, getContextMenu, getCssMetaData, getSkin, getTooltip, isResizable, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
Methods declared in class javafx.scene.layout.Region
backgroundProperty, 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, widthProperty
Methods declared in class javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
Methods declared in class javafx.scene.Node
accessibleHelpProperty, 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, requestFocusTraversal, 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, visibleProperty
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods declared in interface javafx.css.Styleable
getStyleableNode
Property Details
hbarPolicy
public final ObjectProperty<ScrollPane.ScrollBarPolicy> hbarPolicyProperty
- See Also:
vbarPolicy
public final ObjectProperty<ScrollPane.ScrollBarPolicy> vbarPolicyProperty
- See Also:
content
public final ObjectProperty<Node> contentProperty
- See Also:
hvalue
public final DoubleProperty hvalueProperty
hmin to hmax. When hvalue equals hmin, the contained node is positioned so that its layoutBounds minX is visible. When hvalue equals hmax, the contained node is positioned so that its layoutBounds maxX is visible. When hvalue is between hmin and hmax, the contained node is positioned proportionally between layoutBounds minX and layoutBounds maxX.- See Also:
vvalue
public final DoubleProperty vvalueProperty
vmin to vmax. When vvalue equals vmin, the contained node is positioned so that its layoutBounds minY is visible. When vvalue equals vmax, the contained node is positioned so that its layoutBounds maxY is visible. When vvalue is between vmin and vmax, the contained node is positioned proportionally between layoutBounds minY and layoutBounds maxY.- See Also:
hmin
public final DoubleProperty hminProperty
hvalue for this ScrollPane. Default value is 0.- See Also:
vmin
public final DoubleProperty vminProperty
vvalue for this ScrollPane. Default value is 0.- See Also:
hmax
public final DoubleProperty hmaxProperty
hvalue for this ScrollPane. Default value is 1.- See Also:
vmax
public final DoubleProperty vmaxProperty
vvalue for this ScrollPane. Default value is 1.- See Also:
fitToWidth
public final BooleanProperty fitToWidthProperty
- See Also:
fitToHeight
public final BooleanProperty fitToHeightProperty
- See Also:
pannable
public final BooleanProperty pannableProperty
pannable is consulted to determine if the events should be used for panning.- See Also:
prefViewportWidth
public final DoubleProperty prefViewportWidthProperty
- See Also:
prefViewportHeight
public final DoubleProperty prefViewportHeightProperty
- See Also:
minViewportWidth
public final DoubleProperty minViewportWidthProperty
- Since:
- JavaFX 8u40
- See Also:
minViewportHeight
public final DoubleProperty minViewportHeightProperty
- Since:
- JavaFX 8u40
- See Also:
viewportBounds
public final ObjectProperty<Bounds> viewportBoundsProperty
- See Also:
Constructor Details
ScrollPane
public ScrollPane()
ScrollPane
public ScrollPane(Node content)
- Parameters:
-
content- the initial content for the ScrollPane - Since:
- JavaFX 8.0
Method Details
setHbarPolicy
public final void setHbarPolicy(ScrollPane.ScrollBarPolicy value)
hbarPolicy property.- Property description:
- Specifies the policy for showing the horizontal scroll bar.
- Parameters:
-
value- the value for thehbarPolicyproperty - See Also:
getHbarPolicy
public final ScrollPane.ScrollBarPolicy getHbarPolicy()
hbarPolicy property.- Property description:
- Specifies the policy for showing the horizontal scroll bar.
- Returns:
- the value of the
hbarPolicyproperty - See Also:
hbarPolicyProperty
public final ObjectProperty<ScrollPane.ScrollBarPolicy> hbarPolicyProperty()
- Returns:
- the
hbarPolicyproperty - See Also:
setVbarPolicy
public final void setVbarPolicy(ScrollPane.ScrollBarPolicy value)
vbarPolicy property.- Property description:
- Specifies the policy for showing the vertical scroll bar.
- Parameters:
-
value- the value for thevbarPolicyproperty - See Also:
getVbarPolicy
public final ScrollPane.ScrollBarPolicy getVbarPolicy()
vbarPolicy property.- Property description:
- Specifies the policy for showing the vertical scroll bar.
- Returns:
- the value of the
vbarPolicyproperty - See Also:
vbarPolicyProperty
public final ObjectProperty<ScrollPane.ScrollBarPolicy> vbarPolicyProperty()
- Returns:
- the
vbarPolicyproperty - See Also:
setContent
public final void setContent(Node value)
content property.- Property description:
- The node used as the content of this ScrollPane.
- Parameters:
-
value- the value for thecontentproperty - See Also:
getContent
public final Node getContent()
content property.- Property description:
- The node used as the content of this ScrollPane.
- Returns:
- the value of the
contentproperty - See Also:
contentProperty
public final ObjectProperty<Node> contentProperty()
- Returns:
- the
contentproperty - See Also:
setHvalue
public final void setHvalue(double value)
hvalue property.- Property description:
- The current horizontal scroll position of the ScrollPane. This value may be set by the application to scroll the view programmatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of
hmintohmax. Whenhvalueequalshmin, the contained node is positioned so that its layoutBoundsminXis visible. Whenhvalueequalshmax, the contained node is positioned so that its layoutBoundsmaxXis visible. Whenhvalueis betweenhminandhmax, the contained node is positioned proportionally between layoutBoundsminXand layoutBoundsmaxX. - Parameters:
-
value- the value for thehvalueproperty - See Also:
getHvalue
public final double getHvalue()
hvalue property.- Property description:
- The current horizontal scroll position of the ScrollPane. This value may be set by the application to scroll the view programmatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of
hmintohmax. Whenhvalueequalshmin, the contained node is positioned so that its layoutBoundsminXis visible. Whenhvalueequalshmax, the contained node is positioned so that its layoutBoundsmaxXis visible. Whenhvalueis betweenhminandhmax, the contained node is positioned proportionally between layoutBoundsminXand layoutBoundsmaxX. - Returns:
- the value of the
hvalueproperty - See Also:
hvalueProperty
public final DoubleProperty hvalueProperty()
hmin to hmax. When hvalue equals hmin, the contained node is positioned so that its layoutBounds minX is visible. When hvalue equals hmax, the contained node is positioned so that its layoutBounds maxX is visible. When hvalue is between hmin and hmax, the contained node is positioned proportionally between layoutBounds minX and layoutBounds maxX.- Returns:
- the
hvalueproperty - See Also:
setVvalue
public final void setVvalue(double value)
vvalue property.- Property description:
- The current vertical scroll position of the ScrollPane. This value may be set by the application to scroll the view programmatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of
vmintovmax. Whenvvalueequalsvmin, the contained node is positioned so that its layoutBoundsminYis visible. Whenvvalueequalsvmax, the contained node is positioned so that its layoutBoundsmaxYis visible. Whenvvalueis betweenvminandvmax, the contained node is positioned proportionally between layoutBoundsminYand layoutBoundsmaxY. - Parameters:
-
value- the value for thevvalueproperty - See Also:
getVvalue
public final double getVvalue()
vvalue property.- Property description:
- The current vertical scroll position of the ScrollPane. This value may be set by the application to scroll the view programmatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of
vmintovmax. Whenvvalueequalsvmin, the contained node is positioned so that its layoutBoundsminYis visible. Whenvvalueequalsvmax, the contained node is positioned so that its layoutBoundsmaxYis visible. Whenvvalueis betweenvminandvmax, the contained node is positioned proportionally between layoutBoundsminYand layoutBoundsmaxY. - Returns:
- the value of the
vvalueproperty - See Also:
vvalueProperty
public final DoubleProperty vvalueProperty()
vmin to vmax. When vvalue equals vmin, the contained node is positioned so that its layoutBounds minY is visible. When vvalue equals vmax, the contained node is positioned so that its layoutBounds maxY is visible. When vvalue is between vmin and vmax, the contained node is positioned proportionally between layoutBounds minY and layoutBounds maxY.- Returns:
- the
vvalueproperty - See Also:
setHmin
public final void setHmin(double value)
hmin property.- Property description:
- The minimum allowable
hvaluefor this ScrollPane. Default value is 0. - Parameters:
-
value- the value for thehminproperty - See Also:
getHmin
public final double getHmin()
hmin property.- Property description:
- The minimum allowable
hvaluefor this ScrollPane. Default value is 0. - Returns:
- the value of the
hminproperty - See Also:
hminProperty
public final DoubleProperty hminProperty()
hvalue for this ScrollPane. Default value is 0.- Returns:
- the
hminproperty - See Also:
setVmin
public final void setVmin(double value)
vmin property.- Property description:
- The minimum allowable
vvaluefor this ScrollPane. Default value is 0. - Parameters:
-
value- the value for thevminproperty - See Also:
getVmin
public final double getVmin()
vmin property.- Property description:
- The minimum allowable
vvaluefor this ScrollPane. Default value is 0. - Returns:
- the value of the
vminproperty - See Also:
vminProperty
public final DoubleProperty vminProperty()
vvalue for this ScrollPane. Default value is 0.- Returns:
- the
vminproperty - See Also:
setHmax
public final void setHmax(double value)
hmax property.- Property description:
- The maximum allowable
hvaluefor this ScrollPane. Default value is 1. - Parameters:
-
value- the value for thehmaxproperty - See Also:
getHmax
public final double getHmax()
hmax property.- Property description:
- The maximum allowable
hvaluefor this ScrollPane. Default value is 1. - Returns:
- the value of the
hmaxproperty - See Also:
hmaxProperty
public final DoubleProperty hmaxProperty()
hvalue for this ScrollPane. Default value is 1.- Returns:
- the
hmaxproperty - See Also:
setVmax
public final void setVmax(double value)
vmax property.- Property description:
- The maximum allowable
vvaluefor this ScrollPane. Default value is 1. - Parameters:
-
value- the value for thevmaxproperty - See Also:
getVmax
public final double getVmax()
vmax property.- Property description:
- The maximum allowable
vvaluefor this ScrollPane. Default value is 1. - Returns:
- the value of the
vmaxproperty - See Also:
vmaxProperty
public final DoubleProperty vmaxProperty()
vvalue for this ScrollPane. Default value is 1.- Returns:
- the
vmaxproperty - See Also:
setFitToWidth
public final void setFitToWidth(boolean value)
fitToWidth property.- Property description:
- If true and if the contained node is a Resizable, then the node will be kept resized to match the width of the ScrollPane's viewport. If the contained node is not a Resizable, this value is ignored.
- Parameters:
-
value- the value for thefitToWidthproperty - See Also:
isFitToWidth
public final boolean isFitToWidth()
fitToWidth property.- Property description:
- If true and if the contained node is a Resizable, then the node will be kept resized to match the width of the ScrollPane's viewport. If the contained node is not a Resizable, this value is ignored.
- Returns:
- the value of the
fitToWidthproperty - See Also:
fitToWidthProperty
public final BooleanProperty fitToWidthProperty()
- Returns:
- the
fitToWidthproperty - See Also:
setFitToHeight
public final void setFitToHeight(boolean value)
fitToHeight property.- Property description:
- If true and if the contained node is a Resizable, then the node will be kept resized to match the height of the ScrollPane's viewport. If the contained node is not a Resizable, this value is ignored.
- Parameters:
-
value- the value for thefitToHeightproperty - See Also:
isFitToHeight
public final boolean isFitToHeight()
fitToHeight property.- Property description:
- If true and if the contained node is a Resizable, then the node will be kept resized to match the height of the ScrollPane's viewport. If the contained node is not a Resizable, this value is ignored.
- Returns:
- the value of the
fitToHeightproperty - See Also:
fitToHeightProperty
public final BooleanProperty fitToHeightProperty()
- Returns:
- the
fitToHeightproperty - See Also:
setPannable
public final void setPannable(boolean value)
pannable property.- Property description:
- Specifies whether the user should be able to pan the viewport by using the mouse. If mouse events reach the ScrollPane (that is, if mouse events are not blocked by the contained node or one of its children) then
pannableis consulted to determine if the events should be used for panning. - Parameters:
-
value- the value for thepannableproperty - See Also:
isPannable
public final boolean isPannable()
pannable property.- Property description:
- Specifies whether the user should be able to pan the viewport by using the mouse. If mouse events reach the ScrollPane (that is, if mouse events are not blocked by the contained node or one of its children) then
pannableis consulted to determine if the events should be used for panning. - Returns:
- the value of the
pannableproperty - See Also:
pannableProperty
public final BooleanProperty pannableProperty()
pannable is consulted to determine if the events should be used for panning.- Returns:
- the
pannableproperty - See Also:
setPrefViewportWidth
public final void setPrefViewportWidth(double value)
prefViewportWidth property.- Property description:
- Specify the preferred width of the ScrollPane Viewport. This is the width that will be available to the content node. The overall width of the ScrollPane is the ViewportWidth + padding
- Parameters:
-
value- the value for theprefViewportWidthproperty - See Also:
getPrefViewportWidth
public final double getPrefViewportWidth()
prefViewportWidth property.- Property description:
- Specify the preferred width of the ScrollPane Viewport. This is the width that will be available to the content node. The overall width of the ScrollPane is the ViewportWidth + padding
- Returns:
- the value of the
prefViewportWidthproperty - See Also:
prefViewportWidthProperty
public final DoubleProperty prefViewportWidthProperty()
- Returns:
- the
prefViewportWidthproperty - See Also:
setPrefViewportHeight
public final void setPrefViewportHeight(double value)
prefViewportHeight property.- Property description:
- Specify the preferred height of the ScrollPane Viewport. This is the height that will be available to the content node. The overall height of the ScrollPane is the ViewportHeight + padding
- Parameters:
-
value- the value for theprefViewportHeightproperty - See Also:
getPrefViewportHeight
public final double getPrefViewportHeight()
prefViewportHeight property.- Property description:
- Specify the preferred height of the ScrollPane Viewport. This is the height that will be available to the content node. The overall height of the ScrollPane is the ViewportHeight + padding
- Returns:
- the value of the
prefViewportHeightproperty - See Also:
prefViewportHeightProperty
public final DoubleProperty prefViewportHeightProperty()
- Returns:
- the
prefViewportHeightproperty - See Also:
setMinViewportWidth
public final void setMinViewportWidth(double value)
minViewportWidth property.- Property description:
- Specify the minimum width of the ScrollPane Viewport. This is the width that will be available to the content node.
- Parameters:
-
value- the value for theminViewportWidthproperty - Since:
- JavaFX 8u40
- See Also:
getMinViewportWidth
public final double getMinViewportWidth()
minViewportWidth property.- Property description:
- Specify the minimum width of the ScrollPane Viewport. This is the width that will be available to the content node.
- Returns:
- the value of the
minViewportWidthproperty - Since:
- JavaFX 8u40
- See Also:
minViewportWidthProperty
public final DoubleProperty minViewportWidthProperty()
- Returns:
- the
minViewportWidthproperty - Since:
- JavaFX 8u40
- See Also:
setMinViewportHeight
public final void setMinViewportHeight(double value)
minViewportHeight property.- Property description:
- Specify the minimum height of the ScrollPane Viewport. This is the height that will be available to the content node.
- Parameters:
-
value- the value for theminViewportHeightproperty - Since:
- JavaFX 8u40
- See Also:
getMinViewportHeight
public final double getMinViewportHeight()
minViewportHeight property.- Property description:
- Specify the minimum height of the ScrollPane Viewport. This is the height that will be available to the content node.
- Returns:
- the value of the
minViewportHeightproperty - Since:
- JavaFX 8u40
- See Also:
minViewportHeightProperty
public final DoubleProperty minViewportHeightProperty()
- Returns:
- the
minViewportHeightproperty - Since:
- JavaFX 8u40
- See Also:
setViewportBounds
public final void setViewportBounds(Bounds value)
viewportBounds property.- Property description:
- The actual Bounds of the ScrollPane Viewport. This is the Bounds of the content node.
- Parameters:
-
value- the value for theviewportBoundsproperty - See Also:
getViewportBounds
public final Bounds getViewportBounds()
viewportBounds property.- Property description:
- The actual Bounds of the ScrollPane Viewport. This is the Bounds of the content node.
- Returns:
- the value of the
viewportBoundsproperty - See Also:
viewportBoundsProperty
public final ObjectProperty<Bounds> viewportBoundsProperty()
- Returns:
- the
viewportBoundsproperty - See Also:
getClassCssMetaData
public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
CssMetaData associated with this class, which may include the CssMetaData of its superclasses.- Returns:
- the
CssMetaData - Since:
- JavaFX 8.0
getControlCssMetaData
public List<CssMetaData<? extends Styleable,?>> getControlCssMetaData()
- Overrides:
-
getControlCssMetaDatain classControl - Returns:
- the unmodifiable list of the control's CSS-styleable properties
- Since:
- JavaFX 8.0
getInitialFocusTraversable
protected Boolean getInitialFocusTraversable()
- Overrides:
-
getInitialFocusTraversablein classControl - Returns:
- the initial focus traversable state of this control
- Since:
- 9
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.