I have a frame controller class where I am reading values from a form(which is created by using Javafx Scene Builder) and inserting information after controlling their validity. What I want to do is just know how to insert an image to an ImageView element on the stage.
public class FrameController {
@FXML
private ImageView img_view;
....
@FXML
public void ButtonClicked() {
...
img_view = new ImageView();
Image img = new Image("../img/img.jpg");
img_view.setImage(img);
...
}
}
This just does not work. It runs debugger after I clicked the button that is bound to ButtonClicked() function. Am I missing something? How can I insert an image to the ImageView element on the scene? I will really appreciate your help.