can JLabel have img tags

Posted by Aly on Stack Overflow See other posts from Stack Overflow or by Aly
Published on 2010-03-20T19:52:22Z Indexed on 2010/03/20 20:11 UTC
Read the original article Hit count: 455

Filed under:
|
|
|

Hi, I am trying to display a JLabel which has a few lines of text and an image as follows:

String html = "<html> hello </br> <img src = \"/absolute/path/here\" height = \"30\"  width =\"40\"/> </html>";
JLabel l = new JLabel(html);

For the image all I get is a broken image, is it possible to nest img tags inside a JLabel?

EDIT: I want to add multiple images to the JLabel so I don't think the use of an ImageIcon will do here.

Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about jlabel