Cardozz 46 Share Posted June 22, 2016 Hi there. So i've had all this stuff sorted for my elective course for school (the guessing game program i talked about in another topic in this subforum). However, i'd like to add a Mnemonic to the buttons i have (HIGHER and LOWER). The user doesnt have to click the buttons but instead can press 'h' (for button higher) and 'l' for button lower. The only simple solution i found was using the Mnemonic(VK.H), but this requires the user to use ALT + H in order to execute the actionperformed of the button. I played around with it a bit but couldn't find a way to just let it have 'H' as Mnemonic. Is there any way i can simply (so without great workarounds) add a Mnemonic to a button without using VK (alt + key) ? Thanks in advance! And yes, i've searched google already. Link to comment Share on other sites More sharing options...
Nuclear Nezz 2053 Share Posted June 22, 2016 Er are you just asking how to make an applet do X action when they push Y key? In which case just add it to a listener? I'm assuming this is in Java. Link to comment Share on other sites More sharing options...
Mad 86 Share Posted June 23, 2016 http://lmgtfy.com/?q=java+key+listener Link to comment Share on other sites More sharing options...
Cardozz 46 Author Share Posted June 23, 2016 Er are you just asking how to make an applet do X action when they push Y key? In which case just add it to a listener? I'm assuming this is in Java. Yes Nezz. But what will be the code to do that? been searching everywhere for it lol http://lmgtfy.com/?q=java+key+listener Yeah been there, but can't seem to find what i'm really looking for lol Nevermind, ill find it somehow just need to keep digging! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.