If you use URL, the URL starts from src, in this case: Image image = new The result is: BufferedReader reader = new BufferedReader(new If you use the path: right-click on the source file> copy> Path from content Root: How do I copy text files and/or images to the output path in java/IntelliJ? In visual studio, all you have to do is right-click the file then chose " Copy to Output Directory: Always | If Newer" ImageView imageView = new ImageView(image) Īfter reading some questions/answers, it seems like the issue is related to those resources not being copied to the output path. Image(getClass().getResourceAsStream("images/book1.jpg")) try (BufferedReader reader = new BufferedReader(new FileReader("bookList.txt"))) The problem I'm having is that, although I've my text file and images in the same namespace as the Controller.java file, when I run the application, I still get the error that files cannot be found. This is my first time writing a small application in javafx, using IntelliJ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |