ProgressBar which is 25% complete : ProgressBar « JavaFX « Java






ProgressBar which is 25% complete

 

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ProgressBar;
import javafx.stage.Stage;

public class Main extends Application {

  @Override
  public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 260, 80);
    stage.setScene(scene);

    Group g = new Group();

    ProgressBar p2 = new ProgressBar();
    p2.setProgress(0.25F);
    
    g.getChildren().add(p2);
    
    scene.setRoot(g);
    stage.show();
  }

  public static void main(String[] args) {
    launch(args);
  }
}

   
  








Related examples in the same category

1.ProgressBar and Background Processes
2.ProgressBar with an indeterminate value