java.awt.Robot
void mouseMove(int x, int y)
Moves mouse pointer to given screen coordinates.
void mousePress(int buttons)
Presses one or more mouse buttons.
void mouseRelease(int buttons)
Releases one or more mouse buttons.
void mouseWheel(int wheelAmt)
Rotates the scroll wheel on wheel-equipped mice.
void mouseMove(int x, int y)
Moves mouse pointer to given screen coordinates.
void mousePress(int buttons)
Presses one or more mouse buttons.
void mouseRelease(int buttons)
Releases one or more mouse buttons.
void mouseWheel(int wheelAmt)
Rotates the scroll wheel on wheel-equipped mice.
都不显示鼠标指针。然后让键盘事件和鼠标事件,
同时控制一个代替鼠标指针的一个小图片。不过,这样的话,
要实现鼠标单双击就比较麻烦了!good luck
我回去就44
TO:villagehead(村长)
那要两个图片
而且控制起来也难
图片在窗体被其他窗体遮住时容易被刷掉
而且两个图片的话
当鼠标移动到JPane和JLabel等内或上时怎么处理各种时间
我再来恭喜楼主吧!good luck
Robot 好象只模拟现有鼠标的移动按下等事件
要是写按键精灵估计用的着但是我的意思是
比如我写个小游戏要实现双人功能
就必须有两个鼠标出现在屏幕上
我的思路是用鼠标控制一个
用键盘控制一个
键盘控制的那个可以是一个JLabel但事件处理起来很麻烦
还有JLabel会遮住下面的图象
而且很难实现跨JPanel移动