Uses of Class javafx.util.Duration (JavaFX 19)
Description: use: module: javafx.base, package: javafx.util, class: Duration

# Uses of Class
javafx.util.Duration

Packages that use Duration
Package
Description
javafx.animation
Provides the set of classes for ease of use transition based animations.
javafx.concurrent
Provides the set of classes for javafx.concurrent.
javafx.css
Provides API for making properties styleable via CSS and for supporting pseudo-class state.
javafx.css.converter
Provides various `StyleConverter` classes that convert CSS parsed values.
javafx.scene.control
The JavaFX User Interface Controls (UI Controls or just Controls) are specialized Nodes in the JavaFX Scenegraph especially suited for reuse in many different application contexts.
javafx.scene.media
Provides the set of classes for integrating audio and video into Java FX Applications.
javafx.util
Contains various utilities and helper classes.

- ## Uses of Duration in javafx.animation

  Methods in javafx.animation that return Duration
  Modifier and Type
  Method
  Description
  `final Duration`
  Animation.`getCurrentTime()`
  Gets the value of the property currentTime.
  `final Duration`
  Animation.`getCycleDuration()`
  Gets the value of the property cycleDuration.
  `final Duration`
  Animation.`getDelay()`
  Gets the value of the property delay.
  `final Duration`
  FadeTransition.`getDuration()`
  Gets the value of the property duration.
  `final Duration`
  FillTransition.`getDuration()`
  Gets the value of the property duration.
  `final Duration`
  PathTransition.`getDuration()`
  Gets the value of the property duration.
  `final Duration`
  PauseTransition.`getDuration()`
  Gets the value of the property duration.
  `final Duration`
  RotateTransition.`getDuration()`
  Gets the value of the property duration.
  `final Duration`
  ScaleTransition.`getDuration()`
  Gets the value of the property duration.
  `final Duration`
  StrokeTransition.`getDuration()`
  Gets the value of the property duration.
  `final Duration`
  TranslateTransition.`getDuration()`
  Gets the value of the property duration.
  `Duration`
  KeyFrame.`getTime()`
  Returns the time offset of this `KeyFrame`.
  `final Duration`
  Animation.`getTotalDuration()`
  Gets the value of the property totalDuration.
  Methods in javafx.animation that return types with arguments of type Duration
  Modifier and Type
  Method
  Description
  `final ReadOnlyObjectProperty<Duration>`
  Animation.`currentTimeProperty()`
  Defines the `Animation`'s play head position.
  `final ReadOnlyObjectProperty<Duration>`
  Animation.`cycleDurationProperty()`
  Read-only variable to indicate the duration of one cycle of this `Animation`: the time it takes to play from time 0 to the end of the Animation (at the default `rate` of 1.0).
  `final ObjectProperty<Duration>`
  Animation.`delayProperty()`
  Delays the start of an animation.
  `final ObjectProperty<Duration>`
  FadeTransition.`durationProperty()`
  The duration of this `FadeTransition`.
  `final ObjectProperty<Duration>`
  FillTransition.`durationProperty()`
  The duration of this `FillTransition`.
  `final ObjectProperty<Duration>`
  PathTransition.`durationProperty()`
  The duration of this `Transition`.
  `final ObjectProperty<Duration>`
  PauseTransition.`durationProperty()`
  The duration of this `Transition`.
  `final ObjectProperty<Duration>`
  RotateTransition.`durationProperty()`
  The duration of this `RotateTransition`.
  `final ObjectProperty<Duration>`
  ScaleTransition.`durationProperty()`
  The duration of this `ScaleTransition`.
  `final ObjectProperty<Duration>`
  StrokeTransition.`durationProperty()`
  The duration of this `StrokeTransition`.
  `final ObjectProperty<Duration>`
  TranslateTransition.`durationProperty()`
  The duration of this `TranslateTransition`.
  `final ObservableMap<String,Duration>`
  Animation.`getCuePoints()`
  The cue points can be used to mark important positions of the `Animation`.
  `final ReadOnlyObjectProperty<Duration>`
  Animation.`totalDurationProperty()`
  Read-only variable to indicate the total duration of this `Animation`, including repeats.
  Methods in javafx.animation with parameters of type Duration
  Modifier and Type
  Method
  Description
  `void`
  Animation.`jumpTo(Duration time)`
  Jumps to a given position in this `Animation`.
  `void`
  Animation.`playFrom(Duration time)`
  A convenience method to play this `Animation` from a specific position.
  `protected final void`
  Animation.`setCycleDuration(Duration value)`
  Sets the value of the property cycleDuration.
  `final void`
  Animation.`setDelay(Duration value)`
  Sets the value of the property delay.
  `final void`
  FadeTransition.`setDuration(Duration value)`
  Sets the value of the property duration.
  `final void`
  FillTransition.`setDuration(Duration value)`
  Sets the value of the property duration.
  `final void`
  PathTransition.`setDuration(Duration value)`
  Sets the value of the property duration.
  `final void`
  PauseTransition.`setDuration(Duration value)`
  Sets the value of the property duration.
  `final void`
  RotateTransition.`setDuration(Duration value)`
  Sets the value of the property duration.
  `final void`
  ScaleTransition.`setDuration(Duration value)`
  Sets the value of the property duration.
  `final void`
  StrokeTransition.`setDuration(Duration value)`
  Sets the value of the property duration.
  `final void`
  TranslateTransition.`setDuration(Duration value)`
  Sets the value of the property duration.
  `static Interpolator`
  Interpolator.`TANGENT(Duration t, double v)`
  Creates a tangent interpolator, for which in-tangent and out-tangent are identical.
  `static Interpolator`
  Interpolator.`TANGENT(Duration t1, double v1, Duration t2, double v2)`
  Create a tangent interpolator.
  Constructors in javafx.animation with parameters of type Duration
  Modifier
  Constructor
  Description
  ``
  `FadeTransition(Duration duration)`
  The constructor of `FadeTransition`
  ``
  `FadeTransition(Duration duration, Node node)`
  The constructor of `FadeTransition`
  ``
  `FillTransition(Duration duration)`
  The constructor of `FillTransition`
  ``
  `FillTransition(Duration duration, Color fromValue, Color toValue)`
  The constructor of `FillTransition`
  ``
  `FillTransition(Duration duration, Shape shape)`
  The constructor of `FillTransition`
  ``
  `FillTransition(Duration duration, Shape shape, Color fromValue, Color toValue)`
  The constructor of `FillTransition`
  ``
  `KeyFrame(Duration time, String name, KeyValue... values)`
  Constructor of `KeyFrame`
  ``
  `KeyFrame(Duration time, String name, EventHandler<ActionEvent> onFinished, Collection<KeyValue> values)`
  Constructor of `KeyFrame`
  ``
  `KeyFrame(Duration time, String name, EventHandler<ActionEvent> onFinished, KeyValue... values)`
  Constructor of `KeyFrame`
  ``
  `KeyFrame(Duration time, KeyValue... values)`
  Constructor of `KeyFrame`
  ``
  `KeyFrame(Duration time, EventHandler<ActionEvent> onFinished, KeyValue... values)`
  Constructor of `KeyFrame`
  ``
  `PathTransition(Duration duration, Shape path)`
  The constructor of `PathTransition`.
  ``
  `PathTransition(Duration duration, Shape path, Node node)`
  The constructor of `PathTransition`.
  ``
  `PauseTransition(Duration duration)`
  The constructor of `PauseTransition`.
  ``
  `RotateTransition(Duration duration)`
  The constructor of `RotateTransition`
  ``
  `RotateTransition(Duration duration, Node node)`
  The constructor of `RotateTransition`
  ``
  `ScaleTransition(Duration duration)`
  The constructor of `ScaleTransition`
  ``
  `ScaleTransition(Duration duration, Node node)`
  The constructor of `ScaleTransition`
  ``
  `StrokeTransition(Duration duration)`
  The constructor of `StrokeTransition`
  ``
  `StrokeTransition(Duration duration, Color fromValue, Color toValue)`
  The constructor of `StrokeTransition`
  ``
  `StrokeTransition(Duration duration, Shape shape)`
  The constructor of `StrokeTransition`
  ``
  `StrokeTransition(Duration duration, Shape shape, Color fromValue, Color toValue)`
  The constructor of `StrokeTransition`
  ``
  `TranslateTransition(Duration duration)`
  The constructor of `TranslateTransition`
  ``
  `TranslateTransition(Duration duration, Node node)`
  The constructor of `TranslateTransition`

- ## Uses of Duration in javafx.concurrent

  Fields in javafx.concurrent with type parameters of type Duration
  Modifier and Type
  Field
  Description
  `static final Callback<ScheduledService<?>,Duration>`
  ScheduledService.`EXPONENTIAL_BACKOFF_STRATEGY`
  A Callback implementation for the `backoffStrategy` property which will exponentially backoff the period between re-executions in the case of a failure.
  `static final Callback<ScheduledService<?>,Duration>`
  ScheduledService.`LINEAR_BACKOFF_STRATEGY`
  A Callback implementation for the `backoffStrategy` property which will linearly backoff the period between re-executions in the case of a failure.
  `static final Callback<ScheduledService<?>,Duration>`
  ScheduledService.`LOGARITHMIC_BACKOFF_STRATEGY`
  A Callback implementation for the `backoffStrategy` property which will logarithmically backoff the period between re-executions in the case of a failure.
  Methods in javafx.concurrent that return Duration
  Modifier and Type
  Method
  Description
  `final Duration`
  ScheduledService.`getCumulativePeriod()`
  Gets the value of the property cumulativePeriod.
  `final Duration`
  ScheduledService.`getDelay()`
  Gets the value of the property delay.
  `final Duration`
  ScheduledService.`getMaximumCumulativePeriod()`
  Gets the value of the property maximumCumulativePeriod.
  `final Duration`
  ScheduledService.`getPeriod()`
  Gets the value of the property period.
  Methods in javafx.concurrent that return types with arguments of type Duration
  Modifier and Type
  Method
  Description
  `final ObjectProperty<Callback<ScheduledService<?>,Duration>>`
  ScheduledService.`backoffStrategyProperty()`
  Computes the amount of time to add to the period on each failure.
  `final ReadOnlyObjectProperty<Duration>`
  ScheduledService.`cumulativePeriodProperty()`
  The current cumulative period in use between iterations.
  `final ObjectProperty<Duration>`
  ScheduledService.`delayProperty()`
  The initial delay between when the ScheduledService is first started, and when it will begin operation.
  `final Callback<ScheduledService<?>,Duration>`
  ScheduledService.`getBackoffStrategy()`
  Gets the value of the property backoffStrategy.
  `final ObjectProperty<Duration>`
  ScheduledService.`maximumCumulativePeriodProperty()`
  The maximum allowed value for the cumulativePeriod.
  `final ObjectProperty<Duration>`
  ScheduledService.`periodProperty()`
  The minimum amount of time to allow between the start of the last run and the start of the next run.
  Methods in javafx.concurrent with parameters of type Duration
  Modifier and Type
  Method
  Description
  `final void`
  ScheduledService.`setDelay(Duration value)`
  Sets the value of the property delay.
  `final void`
  ScheduledService.`setMaximumCumulativePeriod(Duration value)`
  Sets the value of the property maximumCumulativePeriod.
  `final void`
  ScheduledService.`setPeriod(Duration value)`
  Sets the value of the property period.
  Method parameters in javafx.concurrent with type arguments of type Duration
  Modifier and Type
  Method
  Description
  `final void`
  ScheduledService.`setBackoffStrategy(Callback<ScheduledService<?>,Duration> value)`
  Sets the value of the property backoffStrategy.

- ## Uses of Duration in javafx.css

  Methods in javafx.css that return types with arguments of type Duration
  Modifier and Type
  Method
  Description
  `final CssMetaData<S,Duration>`
  StyleablePropertyFactory.`createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function)`
  Create a CssMetaData<S, Duration> with initial value of Duration.BLACK, and inherit flag defaulting to false.
  `final CssMetaData<S,Duration>`
  StyleablePropertyFactory.`createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue)`
  Create a CssMetaData<S, Duration> with initial value, and inherit flag defaulting to false.
  `final CssMetaData<S,Duration>`
  StyleablePropertyFactory.`createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)`
  Create a CssMetaData<S, Duration> with initial value, and inherit flag.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty)`
  Create a StyleableProperty<Duration> using previously created CssMetaData for the given `cssProperty`.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function)`
  Create a StyleableProperty<Duration>.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue)`
  Create a StyleableProperty<Duration> with initial value.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)`
  Create a StyleableProperty<Duration> with initial value and inherit flag.
  `static StyleConverter<?,Duration>`
  StyleConverter.`getDurationConverter()`
  Return a `StyleConverter` that converts a String representation of a duration to a `Duration`.
  Methods in javafx.css with parameters of type Duration
  Modifier and Type
  Method
  Description
  `final CssMetaData<S,Duration>`
  StyleablePropertyFactory.`createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue)`
  Create a CssMetaData<S, Duration> with initial value, and inherit flag defaulting to false.
  `final CssMetaData<S,Duration>`
  StyleablePropertyFactory.`createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)`
  Create a CssMetaData<S, Duration> with initial value, and inherit flag.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue)`
  Create a StyleableProperty<Duration> with initial value.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)`
  Create a StyleableProperty<Duration> with initial value and inherit flag.
  Method parameters in javafx.css with type arguments of type Duration
  Modifier and Type
  Method
  Description
  `final CssMetaData<S,Duration>`
  StyleablePropertyFactory.`createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function)`
  Create a CssMetaData<S, Duration> with initial value of Duration.BLACK, and inherit flag defaulting to false.
  `final CssMetaData<S,Duration>`
  StyleablePropertyFactory.`createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue)`
  Create a CssMetaData<S, Duration> with initial value, and inherit flag defaulting to false.
  `final CssMetaData<S,Duration>`
  StyleablePropertyFactory.`createDurationCssMetaData(String property, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)`
  Create a CssMetaData<S, Duration> with initial value, and inherit flag.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function)`
  Create a StyleableProperty<Duration>.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue)`
  Create a StyleableProperty<Duration> with initial value.
  `final StyleableProperty<Duration>`
  StyleablePropertyFactory.`createStyleableDurationProperty(S styleable, String propertyName, String cssProperty, Function<S,StyleableProperty<Duration>> function, Duration initialValue, boolean inherits)`
  Create a StyleableProperty<Duration> with initial value and inherit flag.

- ## Uses of Duration in javafx.css.converter

  Methods in javafx.css.converter that return types with arguments of type Duration
  Modifier and Type
  Method
  Description
  `static StyleConverter<ParsedValue<?,Size>,Duration>`
  DurationConverter.`getInstance()`
  Gets the `DurationConverter` instance.

- ## Uses of Duration in javafx.scene.control

  Methods in javafx.scene.control that return Duration
  Modifier and Type
  Method
  Description
  `final Duration`
  Tooltip.`getHideDelay()`
  Gets the value of the property hideDelay.
  `final Duration`
  Spinner.`getInitialDelay()`
  Gets the value of the property initialDelay.
  `final Duration`
  Spinner.`getRepeatDelay()`
  Gets the value of the property repeatDelay.
  `final Duration`
  Tooltip.`getShowDelay()`
  Gets the value of the property showDelay.
  `final Duration`
  Tooltip.`getShowDuration()`
  Gets the value of the property showDuration.
  Methods in javafx.scene.control that return types with arguments of type Duration
  Modifier and Type
  Method
  Description
  `final ObjectProperty<Duration>`
  Tooltip.`hideDelayProperty()`
  The duration in which to continue showing the tooltip after the mouse has left the node.
  `final ObjectProperty<Duration>`
  Spinner.`initialDelayProperty()`
  The duration that the mouse has to be pressed on an arrow button before the next value steps.
  `final ObjectProperty<Duration>`
  Spinner.`repeatDelayProperty()`
  The duration that the mouse has to be pressed for each successive step after the first value steps.
  `final ObjectProperty<Duration>`
  Tooltip.`showDelayProperty()`
  The delay between the mouse entering the hovered node and when the associated tooltip will be shown to the user.
  `final ObjectProperty<Duration>`
  Tooltip.`showDurationProperty()`
  The duration that the tooltip should remain showing for until it is no longer visible to the user.
  Methods in javafx.scene.control with parameters of type Duration
  Modifier and Type
  Method
  Description
  `final void`
  Tooltip.`setHideDelay(Duration hideDelay)`
  Sets the value of the property hideDelay.
  `final void`
  Spinner.`setInitialDelay(Duration value)`
  Sets the value of the property initialDelay.
  `final void`
  Spinner.`setRepeatDelay(Duration value)`
  Sets the value of the property repeatDelay.
  `final void`
  Tooltip.`setShowDelay(Duration showDelay)`
  Sets the value of the property showDelay.
  `final void`
  Tooltip.`setShowDuration(Duration showDuration)`
  Sets the value of the property showDuration.

- ## Uses of Duration in javafx.scene.media

  Methods in javafx.scene.media that return Duration
  Modifier and Type
  Method
  Description
  `final Duration`
  MediaPlayer.`getBufferProgressTime()`
  Retrieves the `bufferProgressTime` value.
  `final Duration`
  MediaPlayer.`getCurrentTime()`
  Retrieves the current media time.
  `final Duration`
  MediaPlayer.`getCycleDuration()`
  Retrieves the cycle duration in seconds.
  `final Duration`
  Media.`getDuration()`
  Retrieve the duration in seconds of the media.
  `final Duration`
  MediaPlayer.`getStartTime()`
  Retrieves the start time.
  `final Duration`
  MediaPlayer.`getStopTime()`
  Retrieves the stop time.
  `final Duration`
  MediaPlayer.`getTotalDuration()`
  Retrieves the total playback duration including all cycles (repetitions).
  Methods in javafx.scene.media that return types with arguments of type Duration
  Modifier and Type
  Method
  Description
  `ReadOnlyObjectProperty<Duration>`
  MediaPlayer.`bufferProgressTimeProperty()`
  The current buffer position indicating how much media can be played without stalling the `MediaPlayer`.
  `ReadOnlyObjectProperty<Duration>`
  MediaPlayer.`currentTimeProperty()`
  The current media playback time.
  `ReadOnlyObjectProperty<Duration>`
  MediaPlayer.`cycleDurationProperty()`
  The amount of time between the `startTime` and `stopTime` of this player.
  `ReadOnlyObjectProperty<Duration>`
  Media.`durationProperty()`
  The duration in seconds of the source media.
  `Pair<String,Duration>`
  MediaMarkerEvent.`getMarker()`
  Retrieves the marker the event represents.
  `final ObservableMap<String,Duration>`
  Media.`getMarkers()`
  Retrieve the markers defined on this `Media` instance.
  `ObjectProperty<Duration>`
  MediaPlayer.`startTimeProperty()`
  The time offset where media should start playing, or restart from when repeating.
  `ObjectProperty<Duration>`
  MediaPlayer.`stopTimeProperty()`
  The time offset where media should stop playing or restart when repeating.
  `ReadOnlyObjectProperty<Duration>`
  MediaPlayer.`totalDurationProperty()`
  The total amount of play time if allowed to play until finished.
  Methods in javafx.scene.media with parameters of type Duration
  Modifier and Type
  Method
  Description
  `void`
  MediaPlayer.`seek(Duration seekTime)`
  Seeks the player to a new playback time.
  `final void`
  MediaPlayer.`setStartTime(Duration value)`
  Sets the start time.
  `final void`
  MediaPlayer.`setStopTime(Duration value)`
  Sets the stop time.

- ## Uses of Duration in javafx.util

  Fields in javafx.util declared as Duration
  Modifier and Type
  Field
  Description
  `static final Duration`
  Duration.`INDEFINITE`
  An Infinite Duration.
  `static final Duration`
  Duration.`ONE`
  A Duration of 1 millisecond.
  `static final Duration`
  Duration.`UNKNOWN`
  A Duration of some unknown amount of time.
  `static final Duration`
  Duration.`ZERO`
  A Duration of 0 (no time).
  Methods in javafx.util that return Duration
  Modifier and Type
  Method
  Description
  `Duration`
  Duration.`add(Duration other)`
  Add this instance and another Duration instance to return a new Duration instance.
  `Duration`
  Duration.`divide(double n)`
  Divide this instance by a number to return a new Duration instance.
  `Duration`
  Duration.`divide(Duration other)`
  Deprecated.
  This method produces surprising results by not taking units into account.
  `static Duration`
  Duration.`hours(double h)`
  Factory method that returns a Duration instance representing the specified number of hours.
  `static Duration`
  Duration.`millis(double ms)`
  Factory method that returns a Duration instance for a specified number of milliseconds.
  `static Duration`
  Duration.`minutes(double m)`
  Factory method that returns a Duration instance representing the specified number of minutes.
  `Duration`
  Duration.`multiply(double n)`
  Multiply this instance with a number representing millis and return a new Duration.
  `Duration`
  Duration.`multiply(Duration other)`
  Deprecated.
  This method produces surprising results by not taking units into account.
  `Duration`
  Duration.`negate()`
  Return a new Duration instance which has a negative number of milliseconds from this instance.
  `static Duration`
  Duration.`seconds(double s)`
  Factory method that returns a Duration instance representing the specified number of seconds.
  `Duration`
  Duration.`subtract(Duration other)`
  Subtract other Duration instance from this instance to return a new Duration instance.
  `static Duration`
  Duration.`valueOf(String time)`
  Factory method that returns a Duration instance for a specified amount of time.
  Methods in javafx.util with parameters of type Duration
  Modifier and Type
  Method
  Description
  `Duration`
  Duration.`add(Duration other)`
  Add this instance and another Duration instance to return a new Duration instance.
  `int`
  Duration.`compareTo(Duration d)`
  Compares durations represented by this object and the specified object.
  `Duration`
  Duration.`divide(Duration other)`
  Deprecated.
  This method produces surprising results by not taking units into account.
  `boolean`
  Duration.`greaterThan(Duration other)`
  Returns true if the specified duration is greater than (>) this instance.
  `boolean`
  Duration.`greaterThanOrEqualTo(Duration other)`
  Returns true if the specified duration is greater than or equal to (>=) this instance.
  `boolean`
  Duration.`lessThan(Duration other)`
  Returns true if the specified duration is less than (<) this instance.
  `boolean`
  Duration.`lessThanOrEqualTo(Duration other)`
  Returns true if the specified duration is less than or equal to (<=) this instance.
  `Duration`
  Duration.`multiply(Duration other)`
  Deprecated.
  This method produces surprising results by not taking units into account.
  `Duration`
  Duration.`subtract(Duration other)`
  Subtract other Duration instance from this instance to return a new Duration instance.