Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
Ron McLeod
Junilu Lacar
Liutauras Vilda
Sheriffs:
Paul Clapham
Jeanne Boyarsky
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Piet Souris
Carey Brown
Bartenders:
Jesse Duncan
Frits Walraven
Mikalai Zaikin
Forum:
Swing / AWT / SWT
MouseEvent.getButton() equal method in jdk1.1
Krishnamurthy Dara
Greenhorn
Posts: 7
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 4632
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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'
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Is it possible to use web-start with jdk1.1?
parseFloat not working in Weblogic 4.5.1
Event that hangs
JSlider and "mouse click"
Class.forName() error
More...