I have a problem with my javafx project which uses maven dependencies. The goal is to upload a file via filechooser (in a configuration control) and then by clicking on a button, change the scene and view the video. The main problem is that the video is imported correctly (I use Files.copy) but it doesn't appear until after recompiling the project. Solutions? Is there another way to copy a video into "resources"? Thank you
Asked
Active
Viewed 24 times
0
-
4*”Is there another way to copy a video into `resources`?”* No. Once the application is packaged, the content of `resources` becomes part of the jar file, which is effectively read-only. Copy the file to a “well-known location”. Typically you can use something like `Paths.get(System.getProperty(“user.home”), “.application-name”)`, creating the directory if necessary. – James_D Aug 26 '22 at 10:30
-
4“Resources” are things that are bundled with the application itself. User-provided files are therefore not resources, and are not accessed the same way. – James_D Aug 26 '22 at 10:39