Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Need some help with Mnemonic in Java.


    Recommended Posts

    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


    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

    Yeah been there, but can't seem to find what i'm really looking for lol :P


    Nevermind, ill find it somehow just need to keep digging!

    Edited by Cardozz
    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.