HTMLEditorKit is looking for default.css file by default - I'm not sure where.
Alternatively, this should work:
StyleSheet ss = new StyleSheet(); ss.importStyleSheet(styleSheetURL); HTMLEditorKit kit = (HTMLEditorKit)jEditorPane.getEditorKit(); kit.setStyleSheet(ss);
However, note that HTMLEditorKit only supports a limited subset of CSS 1.
source share