GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Rich Text Box in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Rich Text Box in Java" Watch "Rich Text Box in Java" New topic
Author

Rich Text Box in Java

Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 63
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!


Life is 10% what happens and 90% how you react to it.
Attitude is everything.
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
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.


bitguru blog
 
GeeCON Prague 2014
 
subject: Rich Text Box in Java