1
私のプログラムのJEditorPaneは、Googleの例のように、googleの例では でしたが、CSSスタイルはまったく表示されません。 ええと、 は私のコードを確認してください。JEditorPaneのウェブサイトが正しく表示されています
JEditorPane editorPane = new JEditorPane() {
public boolean getScrollableTracksViewportWidth() {
return true;
}};
editorPane.setEditable(false);
HTMLEditorKit kit = new HTMLEditorKit();
Document doc = kit.createDefaultDocument();
editorPane.setDocument(doc);
editorPane.setEditorKit(kit);
try {
editorPane.setContentType("text/html");
editorPane.setPage("http://www.google.fr/");
}catch (IOException e) {
editorPane.setContentType("text/html");
editorPane.setText("<html>We can't load this page</html>"
+ e.getMessage() + " ");
}
editorPane.setBounds(295, 265, 491, 474);
editorPane.setBorder(new LineBorder(new Color(0, 0, 0)));
pan.add(editorPane);
私はちょうどニュースなどの情報を表示するためのJavaコンポーネントでWebサイトを表示したい、 誰も私を助けてくださいことができますか?