Question: I am displaying some text in a JLabel. Basically I am generating that text dynamically, and then I apply some HTML tags (e.g., `BR` and `B`) to format the text. Finally I assign this formatted text to my JLabel.

Now I want my Jlabel to automatically wrap the text to the next line when it reaches the end of screen, like the "Word Wrap" feature in Note Pad.

How can I do that?

Answer: 
One way would be to use a `JTextArea` instead of a `JLabel` with `setWrapStyleWord` and `setLineWrap` set to true and with settings to make it look and behave like a `JLabel` (remove the border, make it non-opaque, make it non-editable and non-focusable). 

Otherwise if you absolutely need to use a `JLabel`, you'd be forced to use FontMetrics to measure your text, check for white-space, and then add the HTML hard-breaks in the appropriate positions yourself.
Mix plain text and HTML will switch off auto words wrap in HTML:

```
    jLabel_01.setText("<html>Lorem ipsum long paragraph</html>"); // work good
...
    jLabel_01.setText(""); // will switch off HTML words wrap!!!
...
    jLabel_01.setText("<html>Lorem ipsum long paragraph</html>"); // will not work properly

```

So you can not mix different types (HTML and plain text) of text in one JLabel