Il n'est pas préférable d'utiliser HTMLEditorKit directement.
Utilise plutôt la classe javax.swing.JEditorPane
JEditorPane pane;
pane.setContentType("text/html");
Ensuite, pour introduire du texte source HTML directement:
pane.setText("<HTML></HTML>");
ou pour introduire un source par un fichier:
pane.read(new FileInputStrem("fichier.html"), new HTMLDocument());
Tu pourras récupérer une instance de HTMLEditorKit,si tu n'a pas fait appel à setContentType(), par:
HTMLEditorKit ed= (HTMLEditorKit)pane.getEditorKitForContentType("text/html");
ou si tu as fait appel à setContentType():
HTMLEditorKit ed= (HTMLEditorKit)pane.getEditorKit();
Core Breaker :)