Setting a Mnemonic for Buttons - Java Swing

Java examples for Swing:JButton

Description

Setting a Mnemonic for Buttons

Demo Code

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*/
}

Related Tutorials