-
如何定义文件路径?这是我目前的尝试。我得到一个NullPointerException,但我认为这与输出流有关。它是可以修复的,所以我最担心的是路径。这在访问图像时有效,那么为什么在保存图像时不起作用呢?
// Store chosen profile picture
File outputFile = new File("/resources/profilePicture.png");
ImageIO.write(SwingFXUtils.fromFXImage(croppedProfilePicture, null), "png", outputFile);
谢谢。如果需要,我可以提供更多的信息。