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

GTK LAF: Disabled ComboBox Text and Background is not greyed out

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • None
    • 6u2
    • client-libs

      On GTK LAF the disabled JComboBox is different with 6u2 b01.

      1. The Text is not greyed out

      2. The background color is also remains same.

      It should be greyed out completely as in 7.0.

      Run the following code, note that text of the selected item in the JComboBox look enabled, not greyed out.

      import java.awt.*;
      import javax.swing.*;

      public class DisabledComboBox{
          
          public static void main(String args[]) {
              try {
                  UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
              }catch(Exception e){
                  e.printStackTrace();
              };
              SwingUtilities.invokeLater(new Runnable() {
                  public void run() {
                      JComboBox jComboBox1 = new JComboBox();
                      jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Disable Combo", "Item1", "Item2"}));
                      jComboBox1.setEnabled(false);
                      JFrame test = new JFrame("Combo Text");
                      test.add(jComboBox1, BorderLayout.SOUTH);
                      test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                      test.setSize(300, 200);
                      test.setLocationRelativeTo(null);
                      test.setVisible(true);
                  }
              });
          }
      }

            peterz Peter Zhelezniakov
            esubramasunw Elancheran Subramanian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: