JavaFX Cirlce

A circle is a special type of ellipse with both of the focal points at the same position. Its horizontal radius is equal to its vertical radius. JavaFX allows us to create Circle on the GUI of any application by just instantiating javafx.scene.shape.Circle class. Just set the class properties by using the instance setter methods and add the class object to the Group.

Properties

The class properties along with the setter methods and their description are given below in the table.

PropertyDescriptionSetter Methods
centerXX coordinate of the centre of circlesetCenterX(Double value)
centerYY coordinate of the centre of circlesetCenterY(Double value)
radiousRadius of the circlesetRadius(Double value)

Example:


JavaFX Circle Output

Next TopicJavaFX Polygons




Latest Courses