当前位置: 技术问答>java相关
请问:如何让鼠标的图标在进入一个JPanel后变为我指定的图标?
来源: 互联网 发布时间:2015-05-25
本文导语: 请问:如何让鼠标的图标在进入一个JPanel后变为我指定的图标? | createCustomCursor public Cursor createCustomCursor(Image cursor, Point hotSpot, ...
请问:如何让鼠标的图标在进入一个JPanel后变为我指定的图标?
|
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.
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.
|
你指定的图标,指的是什么呀
是沙漏等还是自己定义的图标呀
如是系统自己的
可以这样
setCursor( new Cursor( Cursor.WAIT_CURSOR ) );
setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );
等,自己看Cusor还有什么类型好了呵呵
是沙漏等还是自己定义的图标呀
如是系统自己的
可以这样
setCursor( new Cursor( Cursor.WAIT_CURSOR ) );
setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );
等,自己看Cusor还有什么类型好了呵呵