Java examples for Swing:JButton
Setting a Mnemonic for Buttons
import javax.swing.JButton; import javax.swing.JCheckBox; public class Main { public void m() throws Exception { JButton button = new JButton("Button"); button.setMnemonic('B'); JCheckBox checkBox = new JCheckBox("CheckBox"); checkBox.setMnemonic('C'); }/*from w w w . j av a 2s.com*/ }