File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Swing / AWT / SWT
Author
MouseEvent.getButton() equal method in jdk1.1
Krishnamurthy Dara
Greenhorn
Joined: Jul 27, 2006
Posts: 7
posted
Sep 13, 2006 04:41:00
0
Hi All,
I am using jdk1.1 version. What is the equal method in jdk1.1 for
MouseEvent.getButton(). To catch the right click on the screen.
Thanks,
krishna
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
Sep 13, 2006 13:03:00
0
don't know what is/isn't supported in 1.1, but try these
public void mousePressed(MouseEvent me) { String btn = me.isMetaDown()? "Right":"Left"; String btn1 = me.getModifiers() == 4? "Right":"Left"; String btn2 = SwingUtilities.isRightMouseButton(me)? "Right":"Left"; System.out.println("btn = "+btn+"\n"+"btn1 = "+btn1+"\n"+"btn2 = "+btn2); }
note: needs additional code if you want to specifically ID the left button
i.e. as is, the mouse wheel button will also show as 'left'
I agree. Here's the link:
http://aspose.com/file-tools
subject: MouseEvent.getButton() equal method in jdk1.1
Similar Threads
Event that hangs
JSlider and "mouse click"
parseFloat not working in Weblogic 4.5.1
Is it possible to use web-start with jdk1.1?
Class.forName() error
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter