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

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

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      x86
    • OS:
      windows_95
    • Verification:
      Not verified

      Description

      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();
          }
      }

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: