Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4740519

HTML JLabel not greyed out on setEnabled(false)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.1
    • client-libs



      Name: gm110360 Date: 09/02/2002


      FULL PRODUCT VERSION :
      java version "1.4.1-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
      Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)


      FULL OPERATING SYSTEM VERSION :

      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      When using HTML in a JLabel, setEnabled does not grey out
      the label, as in an ordinary label. It is important it
      supports this behaviour because labels are often used with
      other greyed out components (possibly in a bordered panel),
      and when the other components are greyed out as a group,
      the labels should be greyed out too; otherwise the
      appearance is poor.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.See the source code below
      2.
      3.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      This is obvious when running the example below; both labels
      should look the same, but they don't.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JLabel;
      import javax.swing.JFrame;
      import java.awt.FlowLayout;
      import java.awt.Container;

      public class Bug extends JFrame {
          public Bug() {
              Container cp = getContentPane();

              cp.setLayout(new FlowLayout());
              JLabel l1 = new JLabel("Ordinary label");
              l1.setEnabled(false);
              cp.add(l1);

              JLabel l2 = new JLabel("<html>Html label</html>");
              l2.setEnabled(false);
              cp.add(l2);

              pack();
              show();
          }

          public static void main(String a[]) {
              new Bug();
          }

      }

      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      None known by me
      (Review ID: 163929)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: