예제 #1
0
  public PrefOptionList(PrefMonitor<String> pref, StringGetter labelStr, PrefOption[] options) {
    this.pref = pref;
    this.labelStr = labelStr;

    label = new JLabel(labelStr.get() + " ");
    combo = new JComboBox();
    for (PrefOption opt : options) {
      combo.addItem(opt);
    }

    combo.addActionListener(this);
    pref.addPropertyChangeListener(this);
    selectOption(pref.get());
  }
예제 #2
0
 void localeChanged() {
   label.setText(labelStr.get() + " ");
 }