org.openide.awt 7.39.1

org.openide.awt
Class Mnemonics

java.lang.Object
  extended by org.openide.awt.Mnemonics

public final class Mnemonics
extends Object

Support class for setting button, menu, and label text strings with mnemonics.

Since:
3.37
See Also:
Issue #26640

Method Summary
static int findMnemonicAmpersand(String text)
          Searches for an ampersand in a string which indicates a mnemonic.
static void setLocalizedText(AbstractButton item, String text)
          Sets the text for a menu item or other subclass of AbstractButton.
static void setLocalizedText(JLabel item, String text)
          Sets the text for the label or other subclass of JLabel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setLocalizedText

public static void setLocalizedText(AbstractButton item,
                                    String text)
Sets the text for a menu item or other subclass of AbstractButton.

Examples:

Input String View under JDK 1.4 or later
Save &As Save As
Rock & Roll Rock & Roll
Drag & &Drop Drag & Drop
&Файл Файл

Parameters:
item - a button whose text will be changed
text - new label

setLocalizedText

public static void setLocalizedText(JLabel item,
                                    String text)
Sets the text for the label or other subclass of JLabel. For details see setLocalizedText(AbstractButton, String).

Parameters:
item - a label whose text will be set
text - new label

findMnemonicAmpersand

public static int findMnemonicAmpersand(String text)
Searches for an ampersand in a string which indicates a mnemonic. Recognizes the following cases:

Parameters:
text - text to search
Returns:
the position of mnemonic ampersand in text, or -1 if there is none

org.openide.awt 7.39.1

Built on December 7 2011.  |  Portions Copyright 1997-2011 Oracle. All rights reserved.