class GuiLangConfigPanel extends JPanel implements SavablePanel, ItemListener {

  private final LocalStorage storage;
  private final ResourceBundle messages;
  private final LanguageComboBox languageBox;
  private final LanguageAdapter system;
  private final JLabel needsRestartLabel = new JLabel("");
  private boolean needsRestart = false;
  private LanguageAdapter guiLang = null;

  GuiLangConfigPanel(ResourceBundle messages, LocalStorage storage) {
    super(new GridBagLayout());
    applyComponentOrientation(
      ComponentOrientation.getOrientation(Locale.getDefault()));
    setBorder(BorderFactory.createTitledBorder(messages.getString("guiLanguage")));
    this.messages = messages;    
    this.storage = storage;
    system = new LanguageAdapter(messages.getString("guiLanguageSystem"));
    //create a ComboBox with flags, do not include hidden languages,
    //use system as first option
    languageBox = LanguageComboBox.create(messages, "", true, false, system);

    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(2, 2, 2, 2);
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 1;
    c.anchor = GridBagConstraints.LINE_START;
    add(languageBox, c);
    c.gridy = 1;
    c.fill = GridBagConstraints.HORIZONTAL;
    add(needsRestartLabel, c);
  }

  @Override
  public void itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.SELECTED) {
      guiLang = (LanguageAdapter) e.getItem();
      needsRestartLabel.setText(messages.getString("quiLanguageNeedsRestart"));
      needsRestartLabel.setForeground(Color.red);      
    }
  }

  @Override
  public void componentShowing() {
    languageBox.removeItemListener(this);
    loadOption();
    languageBox.addItemListener(this);
  }

  @Override
  public void save() {
    if (guiLang == null) {
      return;
    }
    needsRestart = true;    
    if (guiLang.getLanguage() != null) {
      storage.saveProperty("gui.locale", new LocaleBean(
              guiLang.getLanguage().getLocaleWithCountryAndVariant()));
    } else {
      storage.saveProperty("gui.locale", null);
    }
  }

  private void loadOption() {<FILL_FUNCTION_BODY>}
}

    guiLang = null;
    if (!needsRestart) {
      needsRestartLabel.setText("");
    }    
    LocaleBean lang = storage.loadProperty("gui.locale", LocaleBean.class);
    if (lang != null) {
      Locale l = lang.asLocale();
      languageBox.selectLanguage(Languages.getLanguageForLocale(l));
    } else {
      languageBox.setSelectedItem(system);
    }
  
<methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void setUI(javax.swing.plaf.PanelUI) ,public void updateUI() <variables>private static final java.lang.String uiClassID