我在编辑器窗格中加载 HTML 文件并显示它时遇到问题。我正在使用的代码是:
window_pane = new JEditorPane("file:///assets/www/index.html");
但这只是给出了一些错误:
Exception in thread "main" java.io.FileNotFoundException: \assets\www\index.html (Het systeem kan het opgegeven pad niet vinden)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at javax.swing.JEditorPane.getStream(Unknown Source)
at javax.swing.JEditorPane.setPage(Unknown Source)
at javax.swing.JEditorPane.setPage(Unknown Source)
at javax.swing.JEditorPane.<init>(Unknown Source)
at nl.xedus.battlex.java.WebBrowser.<init>(WebBrowser.java:33)
at nl.xedus.battlex.java.WebBrowser.main(WebBrowser.java:72)
截屏:
有人可以帮忙吗?