I know how to use accelerators and mnemonics, but not "true" hotkeys.
Can someone explain me, step by step, how it works?
I want to add hotkey "1" to JButton (on numeric too(is there any difference between them?))
- It'll call actionPerformed? Or I can call my own function?
- What with other objects(JMenuItem, JCheckbox, JCombobox)?
This is base code that I'm using:
JButton b1 = new JButton("1");
setLayout(null);
b1.setBounds(0,0,50,50);
b1.addActionListener(this);
add(b1);
Please explain it, don't paste links. Thanks in advance.