String str = getSpecializedString(name + MNEMONIC_SUFFIX,
specialization);
if (str.length() == 1) {
item.setMnemonic(str.charAt(0));
} else {
throw new ResourceFormatException("Malformed mnemonic",
bundle.getClass().getName(),
name+MNEMONIC_SUFFIX);
}
} catch (MissingResourceException e) {
}
// Accelerator
try {
if (!(item instanceof JMenu)) {
String str = getSpecializedString(name + ACCELERATOR_SUFFIX,
specialization);
KeyStroke ks = KeyStroke.getKeyStroke(str);
if (ks != null) {
item.setAccelerator(ks);
} else {
throw new ResourceFormatException
("Malformed accelerator",
bundle.getClass().getName(),
name+ACCELERATOR_SUFFIX);
}
}