use of com.jfoenix.controls.JFXProgressBar in project JFoenix by jfoenixadmin.
the class ProgressBarDemo method start.
@Override
public void start(Stage stage) throws Exception {
pane = new VBox();
pane.setSpacing(30);
pane.setStyle("-fx-background-color:WHITE");
ProgressBar bar = new ProgressBar();
bar.setPrefWidth(500);
ProgressBar cssBar = new ProgressBar();
cssBar.setPrefWidth(500);
cssBar.setProgress(-1.0f);
JFXProgressBar jfxBar = new JFXProgressBar();
jfxBar.setPrefWidth(500);
JFXProgressBar jfxBarInf = new JFXProgressBar();
jfxBarInf.setPrefWidth(500);
jfxBarInf.setProgress(-1.0f);
Timeline timeline = new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(bar.progressProperty(), 0), new KeyValue(jfxBar.progressProperty(), 0)), new KeyFrame(Duration.seconds(2), new KeyValue(bar.progressProperty(), 1), new KeyValue(jfxBar.progressProperty(), 1)));
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.play();
pane.getChildren().addAll(bar, jfxBar, cssBar, jfxBarInf);
StackPane main = new StackPane();
main.getChildren().add(pane);
main.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
StackPane.setMargin(pane, new Insets(20, 0, 0, 20));
final Scene scene = new Scene(main, 600, 200, Color.WHITE);
scene.getStylesheets().add(ProgressBarDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
stage.setTitle("JFX ProgressBar Demo ");
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
Aggregations