当前位置: 技术问答>java相关
applet中如何实现鼠标移到某个区域时,鼠标形状换成手形。就好像超链接一样!
来源: 互联网 发布时间:2015-03-13
本文导语: 谢谢! | java.awt Class Component java.lang.Object | +--java.awt.Component All Implemented Interfaces: ImageObserver, MenuContainer, Serializable Direct Known Subclasses: Button, Canvas, Checkbox, Choice, Container, Labe...
谢谢!
|
java.awt
Class Component
java.lang.Object
|
+--java.awt.Component
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, TextComponent
setCursor
public void setCursor(Cursor cursor)
Sets the cursor image to the specified cursor. This cursor image is displayed when the contains method for this component returns true for the current cursor location, and this Component is visible, displayable, and enabled. Setting the cursor of a Container causes that cursor to be displayed within all of the container's subcomponents, except for those that have a non-null cursor.
Parameters:
cursor - One of the constants defined by the Cursor class; if this parameter is null then this component will inherit the cursor of its parent
Since:
JDK1.1
See Also:
isEnabled(), isShowing(), getCursor(), contains(int, int), Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String), Cursor
Class Component
java.lang.Object
|
+--java.awt.Component
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, TextComponent
setCursor
public void setCursor(Cursor cursor)
Sets the cursor image to the specified cursor. This cursor image is displayed when the contains method for this component returns true for the current cursor location, and this Component is visible, displayable, and enabled. Setting the cursor of a Container causes that cursor to be displayed within all of the container's subcomponents, except for those that have a non-null cursor.
Parameters:
cursor - One of the constants defined by the Cursor class; if this parameter is null then this component will inherit the cursor of its parent
Since:
JDK1.1
See Also:
isEnabled(), isShowing(), getCursor(), contains(int, int), Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String), Cursor