title: Is it Bad Practice to use HTML Styling in Java Swing Elements?
body: <p>It is considered bad practice to style Swing elements using HTML?</p>
  
  <p>As an example, if I want to make a label bigger and red just once, I have two options:</p>
  
  <p>Either using API calls:</p>
  
  <pre><code>JLabel label = new JLabel("This is a title");  
  label.setFont(label.getFont().deriveFont(18));  
  label.setForeground(Color.red);
  </code></pre>
  
  <p>Or by using HTML:</p>
  
  <pre><code>JLabel label = new JLabel("&lt;html&gt;&lt;font size='4' color='#ff0000'&gt;This is a title");
  </code></pre>
  
  <p>In addition, the <em>HTML way</em> allows me to emphasise one word instead of a whole label, and other such uses.</p>
  
  <p>What are the drawbacks of using HTML? Is it more expensive? And is formatting not guaranteed on all JREs?</p>