I have a java project in Eclipse and I have made the images I want as variables, and set the ImageViews to the images. When I run it, the images show as expected, but when I try to export the file the images don't show, but the ImageViews are still there (I know that because when I click on them they change a label). I have put the images into the project in a "ressources" source folder.
public class MainWindowController implements Initializable{
private Main main;
@FXML
private TextField field;
@FXML
private Label bottomLabel;
@FXML
private ImageView rightImageView;
@FXML
private ImageView leftImageView;
public void initialize(URL location, ResourceBundle ressources){
Image encryptImage = new Image("file:src/encrypt.jpeg");
Image decryptImage = new Image("file:src/decrypt.jpeg");
rightImageView.setImage(encryptImage);
leftImageView.setImage(decryptImage);
}
When I export it, I select "Runnable JAR File" and "Package required libraries into JAR"
Thanks