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

method java.awt.dnd.DragSourceContext.setCursor doesn't set cursor

XMLWordPrintable

    • 1.2beta4
    • sparc
    • solaris_2.5
    • Verified



      Name: sdC67446 Date: 11/11/97


      java.awt.dnd.DragSourceContext.setCursor doesn't change cursor.
      It always equals to null.

      Here is the JDK Specification:
      --------------------------------------------------
       setCursor

       public void setCursor(Cursor c)

           change the drag cursor
           
      Here is the test demonstrating the bug:
      -----------------Test.java------------------------
      import java.awt.dnd.*;
      import java.awt.dnd.peer.*;
      import java.awt.*;

      public class Test {
          public static void main(String[] args) {
              DragSourceContextPeer dscp = new DragSourceContextPeer() {
                  Cursor cursor;
                  public void startDrag(DragSourceContext ds, AWTEvent trigger, int actions) {}
                  public Component getComponent() {return null;}
                  public boolean isDnDTrigger(AWTEvent awte) {return false;}
                  public void cancelDrag() {}
                  public void commitDrop() {}
                  public int getSourceActions() {return 0;}
                  public void setSourceActions(int a) {}
                  public Cursor getCursor() {return cursor;}
                  public void setCursor(Cursor c) {cursor = c;}
                  public AWTEvent getTrigger() {return null;}
              };
              DragSourceContext dsc = new DragSourceContext(null, dscp, null, 0, null, null, null, null);
              dsc.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
              if (dsc.getCursor() == null)
                  System.out.println("dsc.getCursor() == null.");
          }
      }

      ---------Output from the test---------------------
      dsc.getCursor() == null.
      --------------------------------------------------

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

            lcablesunw Larry Cable (Inactive)
            sdmitriesunw Sergei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: