title: How to find out if there is a line break in a JLabel when using HTML?
body: <p>I am using the HTML style formatting with JLabels - which I find very powerful.</p>
  
  <pre><code>JLabel jLabel;
  jLabel.setText("&lt;html&gt;&lt;center&gt;Long long text with many many words&lt;/center&gt;`&lt;/html&gt;");
  </code></pre>
  
  <p>As you can see, any text I enter into the JLabel - gets centered and can even go into "next line" (do a line break) if the horizontal space is shorter than the length of the text.</p>
  
  <p>My question now is: is there a way to detect if such a line break occurred?</p>
  
  <p>For example I want my code to act in a different way if some text is long enough for a line break and different if it fits to one line.</p>
  
  <p>Something like: <code>.getNumberOfLineBreaks()</code></p>