java - Certain images not getting loaded with relative path - JavaFX -
java - Certain images not getting loaded with relative path - JavaFX -
i'm developing portable desktop application , ui uses images. application's absolute path is: c:/users/jp/documents/eol/collection/datacollection/src/application/
i have fxml , main class source files in application folder(specified above) , 3 images in "images" folder within application folder. .jpg files. when reference these files in fxml file using relative path, 1 gets loaded while other 2 doesn't.
i don't know why 1 specific file loads while others fails load.
when reference 1 file in 3 locations of fxml, works fine. , when reference 3 different images absolute paths, works fine. i'm not understanding issue relative paths respect few files. can help me this?
i've tried replacing '@' "file:", didn't help.
<imageview fitheight="333.0" fitwidth="450.0" opacity="0.27"> <image> <image url="@images/ht.jpg" /> </image> </imageview> <imageview fitheight="70.0" fitwidth="68.0" layoutx="5.0" layouty="7.0"> <image> <image url="@images/eol.jpg" /> </image> </imageview> <imageview fitheight="103.0" fitwidth="162.0" layoutx="78.0" layouty="-9.0" preserveratio="true"> <image> <image url="@images/eol2.gif" /> </image> </imageview>
java javafx relative-path fxml image-loading
Comments
Post a Comment