1
我有一個XML文件,它使用存儲在文件夾中的XSS和XSL以正確的格式顯示XML。 當我使用下面的代碼在JEditorPane中顯示帶有樣式表的XML
JEditorPane editor = new JEditorPane();
editor.setBounds(114, 65, 262, 186);
frame.getContentPane().add(editor);
editor.setContentType("html");
File file=new File("c:/r/testResult.xml");
editor.setPage(file.toURI().toURL());
所有我能看到的是XML的文本部分,沒有任何造型。我應該怎麼做才能使這個顯示樣式表。
謝謝:)幫了很多 – sam