public void actionPerformed(ActionEvent e) { PrefOption x = (PrefOption) combo.getSelectedItem(); pref.set((String) x.getValue()); }