I have a project, I'm creating an application in Java and I need text editor with sample functions (Bold, Italic, Size, Align, Undo, Redo).
So is there a class in Java for t开发者_高级运维his purpose or a tutorial to show how to develop it?
I tried to style text in a jTextPane but when I change a word in bold, the whole text become in bold.
I want just to stylize the selected text only.
This should get you started: Editor based on JTextPane
Or this tutorial: How to Use Editor Panes and Text Panes
(source: oracle.com)
The Java Tutorial's TextComponentDemo illustrates many features such as undo/redo, styling selected text and binding key strokes to editing actions.
精彩评论