Se avessi provato a leggere un po' di più la roba trovata al link che ti ho postato solo ieri, saresti giunto al codice dell'esempio
codice:
private JTextPane createTextPane() {
String[] initString =
{ "This is an editable JTextPane, ", //regular
"another ", //italic
"styled ", //bold
"text ", //small
"component, ", //large
"which supports embedded components..." + newline,//regular
" " + newline, //button
"...and embedded icons..." + newline, //regular
" ", //icon
newline + "JTextPane is a subclass of JEditorPane that " +
"uses a StyledEditorKit and StyledDocument, and provides " +
"cover methods for interacting with those objects."
};
String[] initStyles =
{ "regular", "italic", "bold", "small", "large",
"regular", "button", "regular", "icon",
"regular"
};
JTextPane textPane = new JTextPane();
StyledDocument doc = textPane.getStyledDocument();
addStylesToDocument(doc);
try {
for (int i=0; i < initString.length; i++) {
doc.insertString(doc.getLength(), initString[i],
doc.getStyle(initStyles[i]));
}
} catch (BadLocationException ble) {
System.err.println("Couldn't insert initial text into text pane.");
}
return textPane;
}
Esiste comunque anche la documentazione (linkata sempre in quelle pagine) che spiega chiaramente come il caricare un documento da URL sia solo una delle tante opzioni (a mio avviso la più comoda), ma che nulla vieta l'utilizzo di RTF o il settare il contenuto come nel brano di codice lì sopra.