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

WaitCursor-problems in JDK1.3RC1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      Name: krT82822 Date: 03/12/2000


      12 Mar 2000, eval1127@eng -- shares some aspects with other bugs, incl. # 4297005, but not a clear duplicate of any particular bug.

      java version "1.3.0rc1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-T)
      Java HotSpot(TM) Client VM (build 1.3.0rc1-S, mixed mode)

      Although apparently rewritten for RC1 (there is a new class
      sun.awt.GlobalCursorManager) mouse-cursor-handling still has some nasty
      problems:

      - when changing the mouse-cursor of a JFrame to WAIT_CURSOR, while the cursor
        is above a component which has a mouse-cursor set, the mouse-cursor will not
        change visually
      - when moving the (successfully changed to WAIT_CURSOR) mouse-cursor outside of
        a JFrame (or to the title-bar or Frame-borders) and back into the JFrame, the
        cursor will be reset

      You can use the following program to reproduce these problems:

      -------------------- BEGIN
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class WaitCursorTest
      {
          private static MouseListener listener = new MouseAdapter(){};
          
          public static void main(String Ps_args[])
          {
              final JFrame F_frame = new JFrame();
              F_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              F_frame.getContentPane().setLayout(new FlowLayout());

              JButton F_button = new JButton("1 setCursor");
              F_button.setMnemonic('1');
              F_button.addActionListener(new ActionListener(){
                  JFrame frame = F_frame;
                  public void actionPerformed(ActionEvent e)
                  {
                      frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

                      try
                      {
                        Thread.sleep(2000);
                      }
                      catch (Exception ex)
                      {
                      }

                      frame.setCursor(Cursor.getPredefinedCursor
      (Cursor.DEFAULT_CURSOR));
                  }
              });
              F_frame.getContentPane().add(F_button);

              F_button = new JButton("2 GlassPane");
              F_button.setMnemonic('2');
              F_button.addActionListener(new ActionListener(){
                  JFrame frame = F_frame;
                  public void actionPerformed(ActionEvent e)
                  {
                      JComponent F_gp = (JComponent) frame.getGlassPane();
                      F_gp.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                      F_gp.setVisible(true);
                      frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                      F_gp.addMouseListener(listener);

                      try
                      {
                        Thread.sleep(2000);
                      }
                      catch (Exception ex)
                      {
                      }

                      F_gp.removeMouseListener(listener);
                      frame.setCursor(Cursor.getPredefinedCursor
      (Cursor.DEFAULT_CURSOR));
                      F_gp.setCursor(Cursor.getPredefinedCursor
      (Cursor.DEFAULT_CURSOR));
                      F_gp.setVisible(false);
                  }
              });
              F_frame.getContentPane().add(F_button);

              JTextField F_tf = new JTextField("eins");
              F_frame.getContentPane().add(F_tf);

              F_tf = new JTextField("zwei");
              F_tf.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
              F_frame.getContentPane().add(F_tf);

              F_frame.pack();
              F_frame.setVisible(true);
          }
      }
      -------------------- END

      This program displays a JFrame containing 2 JButtons and 2 JTextFields. The
      first button uses JFrame.setCursor() to set the mouse-cursor to WAIT_CURSOR,
      waits 2 seconds, then resets the mouse-cursor to DEFAULT_CURSOR. The second
      button basically does the same, but using the "GlassPane-method" for changing
      the mouse-cursor instead (I found this method described here in the JDC some
      time ago).

        To reproduce problem 1:
      - move the mouse-cursor to one of the JTextFields (mouse-cursor changes to
        TEXT_CURSOR and CROSSHAIR_CURSOR respectively)
      - invoke button 1 using its mnemonic (i.e. press ALT-1)

        To reproduce problem 2:
      - click button 1 (mouse-cursor changes to WAIT_CURSOR)
      - invoke Button 1 using its mnemonic (i.e. press ALT-1)
      - move mouse-cursor outside of JFrame and back into it

      I believe that these bugs should be fixed in the final JDK1.3!
      (Review ID: 102192)
      ======================================================================

      Name: rlT66838 Date: 05/23/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java Hotspot(TM) Client VM (build 1.3.0-C, mixed mode)

      The bug reported as Bug number 4320939 is NOT fixed even though that
      bug was closed as not reproducible in RC2.

      The impact of this bug is that the user cannot tell when a long-running
      operation has completed if he/she moves the cursor out of the Java GUI window and
      then brings it back . The cursor seems to get reset when it walks
      over the border and often is left as a resize cursor until the Java app restores it to its
      original state. It looks very unprofessional.
      (Review ID: 105230)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              son Oleg Sukhodolsky (Inactive)
              Reporter:
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: