Skip to content Skip to sidebar Skip to footer

Jlabel With Html Containing "<" And ">" Characters

From time to time I use HTML in JLabels in Java Swing. Lastly I've came across something a little bit, for me, confusing... My code: public static void main(String[] args) {

Solution 1:

The JLabel implementation assumes a raw < was part of an invalid opening tag for an html element, and it drops it. You can use &lt; or &#34;.

Solution 2:

Are &lt; and &gt; the only correct options?

As per knowledge you are right.These two are universal accepted.

&lt; means Less than .

&gt; means greater than.

Post a Comment for "Jlabel With Html Containing "<" And ">" Characters"