Java tutorial
import java.awt.event.KeyEvent; import javax.swing.JLabel; import javax.swing.JTextField; public class Main { public static void main(String[] argv) throws Exception { JTextField textfield = new JTextField(25); // Create label and associate with text field JLabel label = new JLabel("Text Label"); label.setDisplayedMnemonic(KeyEvent.VK_L); label.setLabelFor(textfield); } }