你指定的图标,指的是什么呀
是沙漏等还是自己定义的图标呀
如是系统自己的
可以这样
setCursor( new Cursor( Cursor.WAIT_CURSOR ) );
setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );
等,自己看Cusor还有什么类型好了呵呵

解决方案 »

  1.   

    createCustomCursor
    public Cursor createCustomCursor(Image cursor,
                                     Point hotSpot,
                                     String name)
                              throws IndexOutOfBoundsException
    Creates a new custom cursor object. If the image to display is invalid, the cursor will be hidden (made completely transparent), and the hotspot will be set to (0, 0).
    Parameters:
    image - the image to display when the cursor is active.
    hotSpot - the X and Y of the large cursor's hot spot. The hotSpot values must be less than the Dimension returned by getBestCursorSize().
    name - a localized description of the cursor, for Java Accessibility use.
      

  2.   

    createCustomCursorpublic Cursor createCustomCursor(Image cursor,
                                     Point hotSpot,
                                     String name)
                              throws IndexOutOfBoundsExceptionCreates a new custom cursor object. If the image to display is invalid, the cursor will be hidden (made completely transparent), and the hotspot will be set to (0, 0).Parameters:
    image - the image to display when the cursor is active.
    hotSpot - the X and Y of the large cursor's hot spot. The hotSpot values must be less than the Dimension returned by getBestCursorSize().
    name - a localized description of the cursor, for Java Accessibility use.Throws:
    IndexOutOfBoundsException - if the hotSpot values are outside the bounds of the cursor.
    --------------------------------------然后再用 setCursor(Cursor cursor)
      

  3.   

    PS:
    createCustomCursor

    Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String)
      

  4.   

    这里给你一个简单的例子,研究研究吧
    import java.awt.*;
    import javax.swing.*;public class YourClass extends JFrame {
      Cursor cursor;//定义一个 Cursor
      Image img = new ImageIcon("Banana.jpg").getImage();//一个图片  //构造函数
      public YourClass () {
        cursor = this.getToolkit().createCustomCursor(img, new Point(1,1), "Banana");
        this.setCursor(cursor);
      }
      public static void main(String[] args) {
        YourClass c= new YourClass ();
        c.setSize(20,40);
        c.setVisible(true);
      }
    }
    --------------------------------------------------
    Understand???
      

  5.   

    Thank you very much!!!
    i see