If you change the editor kit of a JEditorPane
to HTMLEditorKit
, how do you change it back to the default (plain text) editor kit, like how it is when you first instantiate one? I want it to do this so that I can load all of the html and display it as plain text, not as formatted text, when the user switches to html mode (I'm making a dreamweaver-type app).
I tried:
DefaultEditorKit kit = new DefaultEditorKit();
page.setEditorKit(kit);
But that makes the editor pane uneditable. How can I switch the editor kit back to plain text?