|
|
Creating Accelerator (or Menmonic) Keys in Swing in easy, but a little tricky. This article explains how you would do that JLabel label = new JLabel(); label.setText("Accelerator Key: f"); //Note this, We set the Mnemonic key for Label, not the text field label.setDisplayedMnemonic('f'); JTextField field = new JTextField("Press alt+'f' to focus on this Field "); //Here we associate the Field and the text Field label.setLabelFor(field); //that's it You can download the Full source code here 3 Responses to 'Accelerator/Mnemonic Keys in Swing'Leave a Reply |
Popular Articles
Blog Categories
Monthly Archives
Resources
|
Thanks
Thanks a lot
mcvm8urydd5k1ks4