title: set default disabled font color for <html> JRadioButton
body: <p>I have a JRadioButton with some text, containing html code. When I set it to disabled, color of text doesn't changed to gray or something else. How can I set it to default disabled component text color?
  I can set text color directly in text like:</p>
  
  <pre><code>&lt;html&gt;&lt;font color=someColor&gt;...
  </code></pre>
  
  <p>but how can I get default color for disabled component text?
  Also I've tried to override paint method and use something like this:</p>
  
  <pre><code>Graphics2D g2 = (Graphics2D) g.create();
  g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.35f));
  super.paintComponent(g2);
  g2.dispose();
  </code></pre>
  
  <p>but I didn't got expected result - it became gray, but not identical to default disabled component text color.</p>
  
  <p>So, the solution may be to get disabled color from UIManager.getColor("ComboBox.disabledForeground"); cause this property available in all Os. And here is the code:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  
  public class HTMLJRadio extends JRadioButton {
  
  static String prefixEnabled = "&lt;html&gt;&lt;body style='color: black;'&gt;";
  String text;
  String prefixDisabled;
  
  HTMLJRadio(String text) {
      super(prefixEnabled + text);
      this.text = text;
      Color c = UIManager.getColor("ComboBox.disabledForeground");
      String color = Integer.toHexString(c.getRed()) +
              Integer.toHexString(c.getGreen()) +
              Integer.toHexString(c.getBlue());
      prefixDisabled = "&lt;html&gt;&lt;body style='color: #" + color + ";'&gt;";
  }
  
  public void setEnabled(boolean enabled) {
      super.setEnabled(enabled);
      if (enabled) {
          setText(prefixEnabled + text);
      } else {
          setText(prefixDisabled + text);
      }
  }
  
  public static void showButtons() {
      String htmlText = "&lt;h1&gt;Laf&lt;/h1&gt;&lt;p&gt;Ha Ha!";
      JPanel p = new JPanel(new GridLayout(0, 1, 3, 3));
      HTMLJRadio button1 = new HTMLJRadio(htmlText);
      p.add(button1);
      HTMLJRadio button2 = new HTMLJRadio(htmlText);
      button2.setEnabled(false);
      p.add(button2);
  
      JRadioButton button3 = new JRadioButton("Non html disabled");
      button3.setEnabled(false);
      p.add(button3);
      JOptionPane.showMessageDialog(null, p);
  }
  
  public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
          public void run() {
              try {
                  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch (Exception e) {
              }
              showButtons();
          }
      });
  }
  }
  </code></pre>
  
  <p>On ubuntu it looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/vmiYg.png" alt="enter image description here"></p>
  
  <p>So the disabled radio button with html inside looks very similar to disabled radio button without html inside.
  Also you can use solution from answer, with some magic with images.</p>
  
  <hr>
  
  <p>Edit: (by A.T.) Previously this question was marked as 'correct'.  By mutual agreement, the OP withdrew the correct marking, since the offered answer does not cover the subtleties shown in the screen shot.  It is particularly the 'embossed' effect that is around the text in the lower button, that sets it apart from the disabled HTML formatted button.</p>
  
  <p>Further suggestions as to how to achieve that effect would be appreciated (by both of us).</p>