Open In App

JavaFX | HLineTo Class

HLineTo class is a part of JavaFX. HLineTo class creates a Horizontal line from the present position to specified x coordinate. HLineTo class inherits PathElement class.

Constructor of the class:



  1. HLineTo(): Creates an empty object of HLineTo.
  2. HLineTo(double x): Creates an object of HLineTo with specified value of x coordinate.

Commonly Used Methods:

Method Explanation
getX() Returns the value of x coordinate.
setX(double v) Sets the value of x coordinate.
toString() Returns the string representation of HLineTo object.
xProperty() Defines the X coordinate.

Below programs illustrate the use of HLineTo Class:



Note: The above programs might not run in an online IDE please use an offline compiler.

Reference: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/shape/HLineTo.html


Article Tags :