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

Frame.setCursor() sometimes doesn't update the cursor until user moves the mouse

XMLWordPrintable

    • 1.1.4
    • generic, x86, sparc
    • solaris_2.5.1, solaris_2.6, windows_95, windows_nt
    • Not verified

        This bug only happens on Windows 95 and Windows NT.

        This bug can be reproduced in the following scenario:
        - select a menu from the menubar
        - select a menu item and don't move the mouse
        - the menu item handler sets the busy cursor, does some processing, then reset
          the cursor back to the default cursor.
        - you will see that the busy cursor stays until the user moves the mouse.


        ingrid.yao@Eng 1997-12-10

        No longer works in 1.1.5FCS - 1.1.5 regression bug.

        copy test case from bug 4037573:
        ==============================================

        import java.lang.*;
        import java.awt.*;
        import java.awt.event.*;

        public class cursortest extends Frame implements WindowListener, ActionListener
        {
        Button bdat= new Button("Start Busy");
        public cursortest()
        {

        bdat.addActionListener(this);
        Panel p = new Panel();
        p.setLayout( new BorderLayout() );

        add( p );
        p.add( "North", bdat );
        p.add( "Center", new TextArea( 20, 20 ) );
        addWindowListener(this);
        }

        public void windowClosed(WindowEvent event) {
        }

        public void windowOpened(WindowEvent event) {
        }

        public void windowIconified(WindowEvent event) {
        }

        public void windowDeiconified(WindowEvent event) {
        }

        public void windowActivated(WindowEvent event) {
        }

        public void windowDeactivated(WindowEvent event) {
        }

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

        public void actionPerformed( ActionEvent event)
        {
        Object source = event.getSource();
        if ( source == bdat)
        {
        setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) );
        System.out.println("Starting Sleep for 5 seconds ...");
        System.out.println("Remember to remove your hand from the mouse");
        try { Thread.sleep(5000); } catch( InterruptedException e ){ }
        System.out.println("Done sleeping");
        setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) );
        }
        }

        public static void main( String args[] )
        {
        Frame f = new cursortest();
        f.setSize( 200, 200 );
        f.show();
        }
        }


              msomlosunw Mike Somlo (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: