Recharger un ResourceBundle
Bonjour,
Mon interface swing est en francais et y au bouton qui permet de switcher en anglais
Voici mon Code
Code:
1 2 3 4 5 6 7 8
|
private static Locale DEFAULT = Locale.FRENCH;
private static ResourceBundle dictionary;
static
{
dictionary = ResourceBundle.cgetBundle("Messages", DEFAULT);
} |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| public class Messages {
private static final String BUNDLE_NAME = "Messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private Messages() {
}
public static String getString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
} |
J'ai éssayé de modifier "dictionary" puis de rafraichir mais cela ne marche pas :?
Merci de m'aider à résoudre ce problème