TCM
TCM

Reputation: 16900

How to display image in Swing? in textarea?

I am creating a chat application using JApplet. I have a TextArea where all chat messages go. Everything in working fine and smooth just as you would expect a basic chat application to do. Now i want to add support for gestures. I wanted to know, how can we show an icon in TextArea? it only takes string in append() method.

Upvotes: 4

Views: 7046

Answers (1)

aioobe
aioobe

Reputation: 420921

You should probably be looking at JTextPane instead of JTextArea.

Have a look at this tutorial which among other things, gives this demo:

enter image description here

Upvotes: 3

Related Questions