Module javafx.controls
Package javafx.scene.control

# Class ScrollToEvent<T>

java.lang.Object
java.util.EventObject
javafx.event.Event
javafx.scene.control.ScrollToEvent<T>

All Implemented Interfaces:
  `Serializable`, `Cloneable`

public class ScrollToEvent<T> extends Event
Event related to `ScrollPane` and virtualised controls such as `ListView`, `TableView`, `TreeView` and `TreeTableView`.

Since:
  JavaFX 8.0
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final EventType<ScrollToEvent>`
  `ANY`
  Common supertype for all scroll-to event types.

  ### Fields declared in class javafx.event.Event

  `consumed, eventType, NULL_SOURCE_TARGET, target`

  ### Fields declared in class java.util.EventObject

  `source`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ScrollToEvent(Object source, EventTarget target, EventType<ScrollToEvent<T>> type, T scrollTarget)`
  Construct a new `Event` with the specified event source, target and type.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `getScrollTarget()`
  Gets the target of the scroll-to operation.
  `static <T extends TableColumnBase<?, ?>>
  EventType<ScrollToEvent<T>>`
  `scrollToColumn()`
  This event occurs if the user requests scrolling a `TableColumnBase` (i.e.
  `static EventType<ScrollToEvent<Integer>>`
  `scrollToTopIndex()`
  This event occurs if the user requests scrolling a given index into view.

  ### Methods declared in class javafx.event.Event

  `clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed`

  ### Methods declared in class java.util.EventObject

  `getSource, toString`

  ### Methods declared in class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### ANY

    public static final EventType<ScrollToEvent> ANY
    Common supertype for all scroll-to event types.

- ## Constructor Details

  - ### ScrollToEvent

    public ScrollToEvent(Object source, EventTarget target, EventType<ScrollToEvent<T>> type, T scrollTarget)
    Construct a new `Event` with the specified event source, target and type. If the source or target is set to `null`, it is replaced by the `NULL_SOURCE_TARGET` value.
    Parameters:
      `source` - the event source which sent the event
      `target` - the event source which sent the event
      `type` - the event type
      `scrollTarget` - the target of the scroll to operation

- ## Method Details

  - ### scrollToTopIndex

    public static EventType<ScrollToEvent<Integer>> scrollToTopIndex()
    This event occurs if the user requests scrolling a given index into view.
    Returns:
      the scroll to event type

  - ### scrollToColumn

    public static <T extends TableColumnBase<?, ?>> EventType<ScrollToEvent<T>> scrollToColumn()
    This event occurs if the user requests scrolling a `TableColumnBase` (i.e. `TableColumn` or `TreeTableColumn`) into view.
    Type Parameters:
      `T` - the type
    Returns:
      the scroll to event type

  - ### getScrollTarget

    public T getScrollTarget()
    Gets the target of the scroll-to operation.
    Returns:
      the target of the scroll-to operation