Example usage for javax.swing AbstractButton getDisplayedMnemonicIndex

List of usage examples for javax.swing AbstractButton getDisplayedMnemonicIndex

Introduction

In this page you can find the example usage for javax.swing AbstractButton getDisplayedMnemonicIndex.

Prototype

public int getDisplayedMnemonicIndex() 

Source Link

Document

Returns the character, as an index, that the look and feel should provide decoration for as representing the mnemonic character.

Usage

From source file:Main.java

public static void main(String[] args) {
    AbstractButton jb = new JToggleButton("Press Me");
    System.out.println(jb.getDisplayedMnemonicIndex());

    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);/* w  w  w.  jav a2s  .c  om*/
    f.pack();
    f.setVisible(true);
}