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

Setting cursor for a disabled component sets it to the parent as well.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.2.2, 1.3.0
    • client-libs
    • x86
    • windows_nt



      Name: dsC76792 Date: 05/13/99

      ###@###.###

      The problem exists in JDK1.2.2P,Q, 1.3A,C and the current
      Kestrel build.

      On Win32:
      When a component with non-default cursor is disabled
      its cursor gets propagated to the parent.

      I cannot reproduce this with JDK1.3B: the component's
      and the parent's cursors do not change.

      With JDK1.2.1A disabled component displays parents
      cursor (see #4145822, #4100815).
       
      On both Solaris and Win32:
      When a cursor is set for java.awt.Choice
      it is always set to the parent as well.

      The test case:

      -------------------------------------------------------------
      import java.awt.*;
      import java.awt.event.*;

      public class Test extends WindowAdapter {
          
          public static void main(String args[]) {
              Frame frame = new Frame("Frame");
      frame.setLayout(new GridLayout(4,1));
      frame.add(new TestPanel(new List()));
      frame.add(new TestPanel(new TextField("TextField")));
      frame.add(new TestPanel(new Label("Label")));
      frame.add(new TestPanel(new Choice()));
              frame.addWindowListener(new Test());
              frame.pack();
              frame.setVisible(true);
          }

          public void windowClosing(WindowEvent e) {
              System.exit(0);
          }
      }

      class TestPanel extends Panel implements ItemListener {

          Component target;
          Checkbox toggleEnabled = new Checkbox("enabled", true);

          public TestPanel(Component component) {
              super();
      target = component;
              setLayout(new GridLayout(1,2));
              add(target);
      target.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
           toggleEnabled.addItemListener(this);
           add(toggleEnabled);
          }

          public void itemStateChanged(ItemEvent e) {
      target.setEnabled(!target.isEnabled());
          }

      }
      ---------------------------------------------------------------------

      ======================================================================

            ssisunw Ssi Ssi (Inactive)
            dassunw Das Das (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: