开发者

Text editor in Java with sample functions for desktop application

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

Text editor in Java with sample functions for desktop application


Or this tutorial: How to Use Editor Panes and Text Panes

Text editor in Java with sample functions for desktop application


(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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜