Stop class is a part of JavaFX. Stop class contains an offset and an color. Defines one element of the ramp of colors to use on a gradient. Stop class inherits Object class
Constructor of the class:
- Stop(double o, Color c): Create a new Stop object with specified offset and color.
Commonly Used Methods:
|equals(Object o)||Returns whether two Stop objects are equal or not.|
|getColor()||Returns the color gradient at this offset.|
|getOffset()||Returns the offset of the Stop.|
|hashCode()||Returns the hashcode of the Stop object.|
Java program to create stops add it to linear gradient and apply it to the circle: In this program we will create an array of Stop objects with their offset values ranging from 0 to 1. Create a LinearGradient object with specified stops. Then create a circle with specified x, y positions, and radius and add the linear gradient to it. Create a VBox and set the alignment of it. Add the circle to the vbox and add the vbox to the scene and add the scene to the stage and call the show() function to display the results.
Note: The above programs might not run in an online IDE please use an offline compiler.
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- JavaFX | AmbientLight Class
- JavaFX | TextFlow Class
- JavaFX | Tab Class
- JavaFX | HTMLEditor Class
- JavaFX | Cursor class with examples
- JavaFX | PieChart Class
- JavaFX | Point3D Class
- JavaFX | Shadow Class
- JavaFX | Bloom Class
- JavaFX | Insets Class
- JavaFX | Dimension2D Class
- JavaFX | Point2D Class
- JavaFX | Canvas Class
- JavaFX | Glow Class
- JavaFX | Reflection Class
- JavaFx | GaussianBlur Class
- JavaFX | BoxBlur Class
- JavaFX | DropShadow Class
- JavaFX | MotionBlur Class
- JavaFX | ColorAdjust Class
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.