X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fi18n%2Fgui%2FI18nLabel.java;h=e7c772bc0c7b5f499cd19b3fdb0fb270c1535384;hb=dea23c4a31028ae3382352d4694cad5c8ed0e0bc;hp=f39b254c9bcabb78034b89649b36012b7cea1430;hpb=a31631c92105e985c84e0b79656d35fe3a774f91;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/i18n/gui/I18nLabel.java b/src/net/pterodactylus/jsite/i18n/gui/I18nLabel.java index f39b254..e7c772b 100644 --- a/src/net/pterodactylus/jsite/i18n/gui/I18nLabel.java +++ b/src/net/pterodactylus/jsite/i18n/gui/I18nLabel.java @@ -30,7 +30,6 @@ import net.pterodactylus.jsite.i18n.I18nable; * Label that can update itself from {@link I18n}. * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - * @version $Id$ */ public class I18nLabel extends JLabel implements I18nable { @@ -97,10 +96,10 @@ public class I18nLabel extends JLabel implements I18nable { super(); this.i18nBasename = i18nBasename; this.arguments = arguments; - updateI18n(); if (component != null) { setLabelFor(component); } + updateI18n(); } /** @@ -108,7 +107,9 @@ public class I18nLabel extends JLabel implements I18nable { */ public void updateI18n() { setText(I18n.get(i18nBasename + ".name", arguments)); - setDisplayedMnemonic(I18n.getKey(i18nBasename + ".mnemonic")); + if (getLabelFor() != null) { + setDisplayedMnemonic(I18n.getKey(i18nBasename + ".mnemonic")); + } } }