Java-如何在本地设备上的资源加载映像中使用html

Java-如何在本地设备上的资源加载映像中使用html,java,webview,javafx-webengine,Java,Webview,Javafx Webengine,我正在使用WebEngine(WebView)在资源中加载html文件 URL mapURL = getClass().getResource("/com/yoouppos/resources/aaaaa.html"); webEngine.load(mapURL.toExternalForm()); 和aaaaa.html包含图像标记 <html> <head> </head> <body> <div id='googleMap'

我正在使用WebEngine(WebView)在资源中加载html文件

URL mapURL = getClass().getResource("/com/yoouppos/resources/aaaaa.html");
webEngine.load(mapURL.toExternalForm());
和aaaaa.html包含图像标记

<html>
<head>
</head>
<body>
    <div id='googleMap'>
        <center><img id="pic" src="file:///D:/Dropbox/VietOCR/fax-orders/old_3.jpg" width="auto" height="100%"/></center>
    </div>
</body>
</html>

当我通过NetBean运行project时,将显示图像。 但当我用NetBean进行“清除和构建”时,之后我在dist文件夹中运行jar文件,然后图像就不会显示了


我想显示图像是以本地html格式存储的。

将图像
old_3.jpg
打包到与aaaaa.html相同的位置,并相对引用它


将图像与HTML文件一起放入原始文件夹,然后使用url加载HTML文件:

WV.loadUrl("file:///android_res/raw/aaaaa.html");

old_3.jpg和aaaaa.html的位置不同。old_3.jpg存储在D:/Dropbox/VietOCR/fax orders/文件夹中,aaaaa.html存储在resource@wind将图像放在资源位置,使其与您的代码和html一起出现。此功能是在本地文件夹中显示图像(如D:/Dropbox/VietOCR/fax orders/old_3.jpg)。该路径将由用户更改,因此不能将图像放入资源中。这是java应用程序,不是android应用程序