JFrame f = new MnemoticTest();
JButton b=new JButton("bat");
b.setMnemonic(KeyEvent.VK_B);
f.add(b);
f.setSize(400, 700);
f.setVisible(true);
Hello, I got the above code. When it loads, the 'b' is already underlined. I want the 'b' to be underlined only when I click alt.
On loading it should show no underline, and when I click alt, the b should show up as underlined
How do we do it?