Mic*_*ael 1 java swing timer mouseover wait
我有一个简短的问题,我希望有人可以帮助我.
请查看以下代码段:
public void mouseEntered(MouseEvent e){
//wait 2 seconds.
//if no other mouseEntered-event occurs, execute the following line
//otherwise restart, counting the 2 seconds.
foo();
}
Run Code Online (Sandbox Code Playgroud)
有人可以帮我解决这个问题吗?我想实现像ToolTip这样的行为:你用鼠标进入一个区域.如果您的鼠标停留在该位置,请执行某些操作.
| 归档时间: |
|
| 查看次数: |
1244 次 |
| 最近记录: |