| Author |
About Keybinding
|
Kasun Wixkramanayake
Ranch Hand
Joined: Feb 09, 2010
Posts: 46
|
|
if i use "control alt 7" as key strokes this Code work properly but if use "control s" it dose not work .
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4163
|
|
|
Have you tried using "control S"?
|
luck, db
There are no new questions, but there may be new answers.
|
 |
Kasun Wixkramanayake
Ranch Hand
Joined: Feb 09, 2010
Posts: 46
|
|
Yes i tried but stil it dosent work
|
 |
Kasun Wixkramanayake
Ranch Hand
Joined: Feb 09, 2010
Posts: 46
|
|
in my case i have two buttons called add_button and search_button.I used "control S" for search_button and "control A" for add_button. "control S" is working properly as you said but "control A "is not working
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1788
|
|
Maybe another component is intercepting the KeyStroke.
For example text components use "Control A" to select the text of the component.
If you need more help then post your SSCCE demonstrating the problem.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Kasun Wixkramanayake wrote:
I always prefer the direct way, that doesn't require parsing:
Note that in this case the 'S' needs to be uppercase, or it will be an incorrect key code.
For those wondering, 'S' == KeyEvent.VK_S. I prefer the short version.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1788
|
|
I like using the String so I don't have to create a separate key for the InputMap/ActionMap:
|
 |
 |
|
|
subject: About Keybinding
|
|
|