This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes isAltDown() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "isAltDown()" Watch "isAltDown()" New topic
Author

isAltDown()

Dave Donohoe
Ranch Hand

Joined: May 16, 2000
Posts: 73
Hi all,
I have a JTable, & when the User holds Alt down & clicks on a Cell, I display the entire contents of the Cell to the user in a panel. However, I only want the panel displayed WHILE the user has the alt key pressed.
Currently, I remove the popup in the MouseReleased method. This means that if I want the panel displayed I must hold down the mouse button & the alt key. I want to hold ALT & click once, display the panel & then remove it when the user lets go of the ALT Key.
Any ideas?
D
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Any reason why you don't use double click of the mouse? That is a more normal behaviour for user interfaces.
Dave Donohoe
Ranch Hand

Joined: May 16, 2000
Posts: 73
Hi Paul,
There is a reason why I dont use a double click - basically I need seperate functionality when you double click on a cell.
Regardless, I have figured out the problem but thanks for taking time to reply!
Dave
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
With all of the functionality it seems to have with variouse clicks and key combinations, have you thought of using a pop-up menu?
 
Don't get me started about those stupid light bulbs.
 
subject: isAltDown()
 
Similar Threads
Icon in a JTable
META_KEY
[RichFaces] a4j:commandButton, panel, modalpanel and hotkeys
displaying java.awt.Image in a panel
mnemonic and wiondows L&F