我在Eclipse中有一个java项目,我将我想要的图像作为变量,并将ImageViews设置为图像。当我运行它时,图像显示为预期,但是当我尝试导出文件时,图像不会显示,但ImageView仍然存在(我知道,因为当我点击它们时它们会更改标签)。我已将图像放入" ressources"源文件夹。
公共类MainWindowController实现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);
}
当我导出它时,我选择" Runnable JAR File"和#34;将所需的库打包到JAR"
由于