Reputation: 1537
I am using the standard JavaFX preloader templete. But I am not sure how to link it to my JavaFX program.
public class FXPreloader extends Preloader {
ProgressBar bar;
Stage stage;
.......
}
And here is my Main
public class CIDCV extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("Main.fxml"));
Controller.stage=primaryStage;
Scene scene = new Scene(root);
Controller.stage.setScene(scene);
Controller.stage.setResizable(false);
Controller.stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
All what I am looking for is a splash screen to indicate the program is starting.
Upvotes: 2
Views: 1002
Reputation: 7018
Properties
in pop-up menu.Note for a small project locally the preloader might run so fast you can't even see it. I put in a Thread.sleep(1000) in handleProgressNotification() just to make sure I could see it.
See the section titled 9.2.1 Packaging a Preloader Application in NetBeans IDE in https://docs.oracle.com/javafx/2/deployment/preloaders.htm
Upvotes: 5