Forums Register Login

Fancy Text Area

+Pie Number of slices to send: Send
I'm in the process of writing an AIM clone and I'd like the users to be able to send stylized text to each other. Is there any library out there that includes a custom widget that does this for me already? I'd like to be able to select a block of text, then change it's color, style, etc. I don't really have a problem writing this myself but I figure a third party library exists somewhere that already has all of this functionality. I don't know what the name of the component I'm looking for is called so I'm having a hard time googling it myself. Thanks in advance.
+Pie Number of slices to send: Send
javax.swing.JEditorPane should give you what you want.
+Pie Number of slices to send: Send
Well, right now I'm using JTextPane but setting styles is not really as straightforward as I would like. I was hoping that there was a custom made control somewhere that acted like a JTextPane but already includes a toolbar to let users change colors, fonts, and styles.

Thanks for the response, though.
+Pie Number of slices to send: Send
I see.

We have such a thing at work. If you can wait until Monday, I will look into whether I can post the code here. (If I forget about it, bump this thread.)
+Pie Number of slices to send: Send
I'm sorry - it's too much code to post it here (in fact I'd have some trouble finding out which classes exactly you'll need).

We intend to open source it, be we aren't there yet...

If you have some more specific problems, I'd be open to help you with code snippets, though.
+Pie Number of slices to send: Send
OK, no problem. I hope to tackle this problem later in the week. The first question that immediately comes to mind though is how do I go about appending text to the control? I noticed that JTextArea has an append() method but JTextPane and JEditorPane don't. Right now my only idea is that I will constantly be updating the model that JEditorPane sits on (StylizedDocument, something like that?) so I will constantly be creating a new model and attaching it to the JEditorPane. Oh, by the way, I have no idea what I'm talking about!
+Pie Number of slices to send: Send
You're right, it is not a trivial business. Can I assume that you have not yet followed the link from the API documentation to this tutorial?
+Pie Number of slices to send: Send
This isn't exactly what you want, but you may want to
take a look at the StyleFrame/StyleBox examples from
http://examples.oreilly.com/jswing2/code/#ch22
I knew that guy would be trouble! Thanks tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1373 times.
Similar Threads
getting Date out with JSTL
Internationalization - with images
hosts in LAN
Indexed text files
How to add unique index restriction with EJB/CMP/CMR?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:10:42.