I am using Netbeans IDE, Version 8.1. How can we use Generate Mnemonics Code Property of jLabel? Kindly let me know, how can I use this and where is it useful?As shown in the image, I want to edit highlighted property
2 Answers
Okay, I know this question is old, but I stumbled upon this myself and didn't know how to solve it. So here is the answer for the few people that end up searching for the problem online. The problem is actually, that the checkbox "Generate Mnemonics Code" is disabled in Netbeans. This is the case when the package org.openide.awt
is not in the classpath of the current project. Just add the following to your pom.xml if you use maven and you can finally use this feature again:
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-awt</artifactId>
<version>RELEASE140</version>
</dependency>

- 11
- 2
To use this, check the option to enable it and in Text of the Label choose a word to create a Mnemonic and put a & before it it should create it for you.
For instance you want to create a Mnemonic to when the user choose Alt+F it should choose the label whit the text "First". To do so your text should be "&First".
For more information and some rules check the netbeans faq.

- 264
- 1
- 9