Java – jlabel can have img tag
•
Java
I'm trying to display a jlabel with several lines of text and images as follows: @ h_ 502_ 2@String html = " hello
"; JLabel l = new JLabel(html);
For the image, I get a broken image. Can I embed the embedded img tag into jlabel?
Editor: I want to add multiple images to jlabel, so I don't think using imageicon will be done here
thank you
Solution
Instead of trying to have multiple images on a single jlabel, why not simply have many jlabels, each jlabel has an image (as described by uthark), and then combine all tags on a JPanel This should give you the effect you want with minimal additional complexity
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码