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

RFE: ColorChooser.setEnabled(false) doesn't disable anything

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.6.0"
      Java(TM) SE Runtime Environment (build 1.6.0-b105)
      Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Linux andromeda.basis.com 2.6.16-1.2108_FC4 #1 Thu May 4 23:52:01 EDT 2006 i686 i686 i386 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      ColorChooser.setEnabled(0) doesn't disable any of the sub components, so it's difficult to prevent the user from interacting with the color chooser.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the source code.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the color chooser to prevent me from interacting with the chooser panels.
      ACTUAL -
      I can interact with the chooser panels to my heart's content.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Color;
      import java.awt.Component;
      import java.awt.Container;
      import java.lang.reflect.InvocationTargetException;

      import javax.swing.JColorChooser;
      import javax.swing.JDialog;
      import javax.swing.SwingUtilities;

      public class DisabledColorChooser
      {
          public static void main(String[] p_argv) throws InterruptedException, InvocationTargetException
          {
              final JDialog dialog = new JDialog();
              SwingUtilities.invokeAndWait(new Runnable()
              {
                  public void run()
                  {
                      JColorChooser cc = new JColorChooser();
                      dialog.add(cc);
                      dialog.pack();
                      dialog.setVisible(true);
                      cc.setEnabled(false);
                  }
              });
          }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Recursively disabling the controls seems like it might work, but there is another issue with that.

            malenkov Sergey Malenkov (Inactive)
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: