I'm trying to set an image as the background of GridPane. I do not use fxml code so plain JavaFX code.
public Login() {
grid = new GridPane();
grid.setAlignment (Pos.CENTER);
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(25,25,25,25));
Image img = new Image("/src/application/Images/L.png");
ImageView imgView = new ImageView(getClass().getResource("/src/application/Images/L.png").toExternalForm());
imgView.setImage(img);
grid.getChildren().addAll(imgView);
scene = new Scene (grid, 300, 150);
The exception boils down to this snippet
> Caused by: java.lang.IllegalArgumentException: Invalid URL or resource not found
How do I fix this issue?