This is the code I'm using to display google in a JEditorPane
String url="http://google.com";
editorPane.setEditable(false);
try {
editorPane.setPage(url);
} catch (IOException e) {}
But for some reason the background will always be a blue colour, doesn't matter if I call
setBackgroundColor(Color.WHITE);
setBackgroundColor(Color.WHITE);
? You are setting background color of its parent. Please share some code.editorPane.setBackground(Color.WHITE);
is work perfectly for me and I have added it intoJScrollPane
. – KatharinaJEditorPane
was never intended to render 'real world' HTML. Note that it only supports a subset of HTML 3.2 & (very) basic CSS. – Frilling<span>
or a<font>
, while I have white text (regardless of background and foreground color from Java code) for text in bare<p>
. Note that everything is in the same<p>
, white text or blue text, span or font or bare. – Stupefacient