@Override
	public void start(Stage primaryStage) throws Exception {
		// creating Layout
		final Group root = new Group();
		Scene scene = new Scene(root, 400, 400);
		primaryStage.setScene(scene);
		primaryStage.setResizable(false);
		StackPane waitingPane = new StackPane();
		final ProgressBar progress = new ProgressBar();
		Label load = new Label("loading things...");
		progress.setTranslateY(-25);
		load.setTranslateY(25);
		waitingPane.getChildren().addAll(new Rectangle(400, 400, Color.WHITE),
				load, progress);
		root.getChildren().add(waitingPane);

		// Task for computing the Panels:
		Task<Void> task = new Task<Void>() {
			@Override
			protected Void call() throws Exception {
				for (int i = 0; i < 20; i++) {
					try {
						Thread.sleep(new Random().nextInt(1000));
					} catch (InterruptedException ex) {
						ex.printStackTrace();
					}
					final double prog = i * 0.05;
					Platform.runLater(new Runnable() {
						public void run() {
							progress.setProgress(prog);
						}
					});
				}
				return null;
			}
		};

		// stateProperty for Task:
		task.stateProperty().addListener(new ChangeListener<Worker.State>() {

			@Override
			public void changed(ObservableValue<? extends State> observable,
					State oldValue, Worker.State newState) {
				if (newState == Worker.State.SUCCEEDED) {
					loadPanels(root);
				}
			}
		});

		// start Task
		new Thread(task).start();

		primaryStage.show();
	}