Search code examples
javaswingjtextpane

Change JTextPane EditorKit


How do you change the EditorKit of a JTextPane? I want to change it because I found a better way of setting tab size... but that requires me to set it. I dont want to change it to a EditorPane because my code is built to use the Style feature in it.


Solution

  • My Eclipse was just bugging with the "final" method that it is

    "final" means you can't "extend" the method.

    It doesn't mean you can't "invoke" the method:

    EditorKit editorKit = new SomeBetterEditorKit();
    JTextPane textPane = new JTextPane();
    textPane.setEditorKit( editorKit );