ProgressBar is a part of JavaFX package . It is a specialization of the ProgressIndicator which is represented as a horizontal bar. The progress bar usually shows the amount of completion of a task .
Constructor of the ProgressBar Class are:
- ProgressBar(): creates a new intermediate progress bar.
- ProgressBar(double p): creates a progressbar with a specified progress.
Commonly used methods:
|isIndeterminate()||Gets the value of the property indeterminate.|
|getProgress()||Gets the value of the property progress.|
|setProgress(double v)||Sets the value of the property progress|
Below program illustrate the ProgressBar:
This program creates a progress bar indicated by the name pb. The progress indicator will be created inside a scene, which in turn will be hosted inside a stage (which is the top level JavaFX container). The function setTitle() is used to provide title to the stage. Then a tile pane is created, on which addChildren() method is called to attach the progress indicator and the button inside the scene, along with the resolution specified by (200, 200) in the code. Finally the show() method is called to display the final results.
Note: The following Programs might not run in an online IDE please use an offline Compiler.
- JavaFX | ChoiceDialog
- JavaFX | Box with examples
- JavaFX | Arc with examples
- JavaFX | Pos Class
- JavaFX | TextInputDialog
- JavaFX | MenuButton
- JavaFX | Tab Class
- JavaFX | ProgressIndicator
- JavaFX | Label
- JavaFx | PasswordField
- JavaFX | TextField
- JavaFX | ChoiceBox
- JavaFX | Tooltip
- JavaFX | Checkbox
- JavaFX | CustomMenuItem
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.
Improved By : ManasChhabra2