当前位置: 技术问答>java相关
jdk1.4中如何响应鼠标中间滚轮滚动消息(100分)?
来源: 互联网 发布时间:2015-10-06
本文导语: jdk1.4中,一个extends JComponent 如何响应鼠标中间滚轮滚动消息及得到当前行位置,好通知另一独立new出的scroll bar跟随滚动? | MouseWhellEvent: Method Summary: int getScrollAmount() ...
jdk1.4中,一个extends JComponent 如何响应鼠标中间滚轮滚动消息及得到当前行位置,好通知另一独立new出的scroll bar跟随滚动?
|
MouseWhellEvent:
Method Summary:
int getScrollAmount()
Return the number of units that should be scrolled in response to this event
------------------------
int getScrollType()
Returns the type of scrolling that should take place in response to this event
------------------------
int getUnitsToScroll()
This is a convenience method to aid in the implementation of the common-case MouseWheelListener - to scroll a ScrollPane or JScrollPane by an amount which conforms to the platform settings
------------------------
int getWheelRotation()
Returns the number of "clicks" the mouse wheel was rotated.
------------------------
String paramString()
Returns a parameter string identifying this event.
Method Summary:
int getScrollAmount()
Return the number of units that should be scrolled in response to this event
------------------------
int getScrollType()
Returns the type of scrolling that should take place in response to this event
------------------------
int getUnitsToScroll()
This is a convenience method to aid in the implementation of the common-case MouseWheelListener - to scroll a ScrollPane or JScrollPane by an amount which conforms to the platform settings
------------------------
int getWheelRotation()
Returns the number of "clicks" the mouse wheel was rotated.
------------------------
String paramString()
Returns a parameter string identifying this event.
|
响应滚轴就是响应键盘上的PageUp和PageDown的键盘事件。
|
JDK1.4中提供了MouseWheelEvent和MouseWheelListener