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

fp.bugs 3118 Windows setCursor() waits for mousemove to change

XMLWordPrintable

    • 1.1
    • x86
    • windows_95
    • Not verified

      The solaris implementation of setCursor() works correctly, but as this example demonstrates a mouse movement must occur before setCursor() takes effect under WindowsNT/95.

      import java.awt.*;
      class CursorTest extends Frame {
          CursorTest() {
      add("Center", new Button("change cursor"));
      pack();
      show();
          }
          public boolean handleEvent(Event e) {
      if (e.id == Event.WINDOW_DESTROY) System.exit(0);
      if (e.target instanceof Button) {
      setCursor(Frame.WAIT_CURSOR);
      getToolkit().sync();
      System.out.println("wait cursor");
      try {
      Thread.sleep(2000);
      } catch (InterruptedException ex) {}
      setCursor(Frame.DEFAULT_CURSOR);
      getToolkit().sync();
      System.out.println("default cursor");
      return true;
      }
      return false;
          }
          public static void main(String args[]) {
      new CursorTest();
          }
      }

            tballsunw Tom Ball (Inactive)
            vssriniv Vijay Srinivasan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: