I want to get my generic Picker component to load Preferences on creation and save them on change.
I can easily do the same with a TextField or a CheckBox with the following idiom
checkBox.setSelected(Preferences.get(key, false));
checkBox.addFocusListener(new FocusListener()
{
@Override
public void focusGained(final Component cmp)
{
}
@Override
public void focusLost(final Component cmp)
{
Preferences.set(key, checkBox.isSelected());
}
});
But, for Picker and PickerComponent the idiom is not working since the focus listener is not effective.
How can this be achieved :(
Thank you!