Browse Source

Fixed class cast exception when not using the default spinner editor.

pull/105/head
weisj 5 years ago
parent
commit
8621d74238
  1. 6
      core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java

6
core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java

@ -168,7 +168,11 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements PropertyChangeListe
@Override
protected JComponent createEditor() {
editor = super.createEditor();
editorComponent = ((JSpinner.DefaultEditor) editor).getTextField();
if (editor instanceof JSpinner.DefaultEditor) {
editorComponent = ((JSpinner.DefaultEditor) editor).getTextField();
} else {
editorComponent = editor;
}
editorComponent.addFocusListener(focusListener);
return editor;
}

Loading…
Cancel
Save