Java Text Editor Api
I want to put a text editor in my java application. The editor has to h开发者_StackOverflow社区ave basic formatting features like fonts, bold, color etc..
Ideally I'd like to just add the Text Editor as a component to a JFrame.
Is there any library for this?
I think this could be simply done using a JEditPane, but I don't want to go through all the trouble of making an editor if I could just import one.
From this post on java.net: have a look at Ekit.
The secton from the Swing tutorial on Text Component Features has a quick example how this might be done.
You can't just plug in a component and expect it to work as an editor. You need to add toolbars and menu items for your font, bold color features etc. The editor kits provided by Swing support all these basic features.
You might want to look at SwingX (see the Java Web Start demo on the page), in particular the JXEditorPane
component.
精彩评论