This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rich Text Box in Java  RSS feed

 
Derek Boring
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Everyone!

I want to create a text box that can have formatted, editable text inside of it. The formatting should be changed by buttons on a toolbar. I've investigated the JEditorPane, and I've tried using it, but I can never get it to show anything properly. All the tutorials I've looked at weren't any help. I would also like to know how to get the text in HTML, RTF, and plain text.

Thanks in advance guys!
 
Brian Cole
Author
Ranch Hand
Posts: 949
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Derek Boring:
I want to create a text box that can have formatted, editable text inside of it. The formatting should be changed by buttons on a toolbar. I've investigated the JEditorPane, and I've tried using it, but I can never get it to show anything properly. All the tutorials I've looked at weren't any help. I would also like to know how to get the text in HTML, RTF, and plain text.


JEditorPane would seem to meet all your requirements, with the proviso that its HTML support doesn't handle most of the recent developments in HTML. You would just have to create those toolbar buttons yourself.

If you show us your attempts that didn't "show anything properly" we could perhaps give you some pointers.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!