更改 JTextPane EditorKit

Change JTextPane EditorKit

如何更改 JTextPane 的 EditorKit?我想更改它,因为我找到了一种更好的设置选项卡大小的方法……但这需要我进行设置。我不想将它更改为 EditorPane,因为我的代码是为使用其中的样式功能而构建的。

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

"final" 表示您不能 "extend" 该方法。

这并不意味着你不能"invoke"方法:

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