I have this line:
//Creating an image
Image image = new Image(new FileInputStream("C:\\images\\image.png"));
I would like to change to this line, I would like to get the image from resources in IntelliJ and not from my PC's C drive, for example, but it doesn't work:
Image image = new Image(new FileInputStream("file:src/main/resources/images/image.png"));
or
Image image = new Image(getClass().getResource("file:src/main/resources/images/image.png").toExternalForm());
I have an exception:
Caused by: java.lang.RuntimeException: Exception in Application start method