- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a progress bar using JavaFX?
A progress bar is an indicator of the advancement of an event (a series of steps). You can create a progress bar by instantiating the javafx.scene.control.ProgressBar class.
Example
The following Example demonstrates the creation of a ProgressBar.
import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.ProgressBar; import javafx.scene.control.ProgressIndicator; import javafx.scene.layout.HBox; import javafx.scene.paint.Color; import javafx.stage.Stage; public class ProgressBarExample extends Application { public void start(Stage stage) { //Creating a progress bar ProgressBar progress = new ProgressBar(); //Setting value to the progress bar progress.setProgress(0.5); //Creating a progress indicator ProgressIndicator indicator = new ProgressIndicator(0.6); //Setting the size of the progress bar progress.setPrefSize(300, 30); //Creating a hbox to hold the progress bar and progress indicator HBox hbox = new HBox(20); hbox.setSpacing(5); hbox.setPadding(new Insets(75, 150, 50, 60)); hbox.getChildren().addAll(progress, indicator); //Setting the stage Group root = new Group(hbox); Scene scene = new Scene(root, 595, 200, Color.BEIGE); stage.setTitle("Progress Bar Example"); stage.setScene(scene); stage.show(); } public static void main(String args[]){ launch(args); } }
Output
- Related Articles
- How to create a bar chart using JavaFX?
- How to create a stacked bar chart using JavaFX?
- How to create multi step progress bar using Bootstrap?
- How to create a progress bar in HTML?
- How to create progress bar using the HTML and CSS
- How to create progress bar in ReactJS?
- JavaFX example to set slider to the progress bar
- How to create a download progress bar in Tkinter?
- Create a progress bar with Bootstrap
- Create a striped Bootstrap progress bar
- Creating a Progress Bar using JavaScript
- Create circular Progress Bar in iOS
- How to create progress bar in different colors in Bootstrap
- Create a Bootstrap progress bar with different styles
- How to change progress bar progress color in Android?

Advertisements