How to display image in Swing? in textarea?

I am creating a chat application using JApplet . I have a TextArea where all the chat messages go. Everything in work is beautiful and smooth, as you expect, the application for the main chat. Now I want to add gesture support. I wanted to know how we can show an icon in TextArea? it takes only a string in the append() method.

+4
source share
1 answer

You should JTextPane watch JTextPane instead of JTextArea .

Check out this tutorial , which, among other things, gives this demo:

enter image description here

+3
source

Source: https://habr.com/ru/post/1309398/


All Articles