C
Christian Marko
Hi to all!
I have the following problem:
I want to import an external CSS-file but the defined color of the
styles are not displayed (always black is taken).
Does anyone can give me a hint, why this problem occurs?
As I read in the documentation, the attributes white-space and
text-indent are not rendered. Does anyone know a workaround, because
these attributes are also defined in the CSS-file I got?
Example:
JEditorPane pane = new JEditorPane();
try
{
pane.setPage(getClass().getResource("/myHtmlFile.htm"));
}
catch (Exception e)
{
e.printStackTrace();
}
StyleSheet ss = ((HTMLDocument)pane.getDocument()).getStyleSheet();
try
{
styles.importStyleSheet(getClass().getResource("/myCSSFile.css"));
}
catch (Exception e)
{
e.printStackTrace();
}
thx
Chris
I have the following problem:
I want to import an external CSS-file but the defined color of the
styles are not displayed (always black is taken).
Does anyone can give me a hint, why this problem occurs?
As I read in the documentation, the attributes white-space and
text-indent are not rendered. Does anyone know a workaround, because
these attributes are also defined in the CSS-file I got?
Example:
JEditorPane pane = new JEditorPane();
try
{
pane.setPage(getClass().getResource("/myHtmlFile.htm"));
}
catch (Exception e)
{
e.printStackTrace();
}
StyleSheet ss = ((HTMLDocument)pane.getDocument()).getStyleSheet();
try
{
styles.importStyleSheet(getClass().getResource("/myCSSFile.css"));
}
catch (Exception e)
{
e.printStackTrace();
}
thx
Chris