Topic: 鼠标事件 |
Print this page |
1.鼠标事件 | Copy to clipboard |
Posted by: zvanadium Posted on: 2004-10-11 23:41 鼠标左键和右键同时点击时的事件怎么写?谢了 |
2.Re:鼠标事件 [Re: zvanadium] | Copy to clipboard |
Posted by: floater Posted on: 2004-10-12 09:01 check MouseEvent class, BUTTON2 |
3.Re:鼠标事件 [Re: floater] | Copy to clipboard |
Posted by: zvanadium Posted on: 2004-10-12 11:48 能不能写的详细点,Button2是鼠标中键事件,谢了? |
4.Re:鼠标事件 [Re: zvanadium] | Copy to clipboard |
Posted by: zvanadium Posted on: 2004-10-12 23:17 为什么没人回答啊。 |
5.Re:鼠标事件 [Re: zvanadium] | Copy to clipboard |
Posted by: kavinwang Posted on: 2004-10-13 13:24 SwingUtilities.isLeftMouseButton() &&SwingUtilities.isrightMouseButton() &&event.getClickCount()==1or2 |
6.Re:鼠标事件 [Re: zvanadium] | Copy to clipboard |
Posted by: zvanadium Posted on: 2004-10-13 22:42 这样也不行啊 |
7.Re:鼠标事件 [Re: zvanadium] | Copy to clipboard |
Posted by: kavinwang Posted on: 2004-10-14 09:44 我等会试一下 |
8.Re:鼠标事件 [Re: zvanadium] | Copy to clipboard |
Posted by: kavinwang Posted on: 2004-10-14 10:00 实现MouseAdapter的mouseClicked方法,在方法中进行判断,下面是同时击下时的具体内容,互相判断和限定一下就可解决: java.awt.event.MouseEvent[MOUSE_CLICKED,(143,116),button=1,modifiers=Button1,extModifiers=Button3,clickCount=1] on null.contentPane java.awt.event.MouseEvent[MOUSE_CLICKED,(143,116),button=3,modifiers=Meta+Button3,extModifiers=Meta,clickCount=1] on null.contentPane 一般只判断:button=1,modifiers=Button1,extModifiers=Button3,clickCount=1就可,下面的事件位button3的事件,在处理方法中应忽略 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |