Hi everyone,
I draw FXML GUI,it includes labels and ProgressBar,load it in JavaFX, this is a snippet.
root = FXMLLoader.load(getClass().getResource("StartMenuFXML.fxml"));
label1=(Label)root.lookup("#label");
label2=(Label)root.lookup("#label");
progressBar = (ProgressBar)root.lookup("#ProgressBar");
scene=new Scene(root,600,400);
stage.setTitle("Start Progress");
Progress p = new Progress();
p.start();
stage.setScene(scene);
stage.show();
I need to add a background picture in it, so I add the statements:
GridPane pane = new GridPane();
pane.setTitle("-fx-background-image: url('image1.jpg')");
and change: scene =new Scene(pane,600,400);
It can display the background picture, but I don't know how to display the labels and ProgressBar on the background picture.
Give me a good resolution please!
Thank you so much!