Browse Source

Merge pull request #14 from AlexFalappa/fix/spinnerui

Fix possible ArrayOutOfBoundsException in DarculaSpinnerUI
master
Konstantin Bulenkov 8 years ago committed by GitHub
parent
commit
5bd3e4e23f
  1. 14
      src/com/bulenkov/darcula/ui/DarculaSpinnerUI.java

14
src/com/bulenkov/darcula/ui/DarculaSpinnerUI.java

@ -52,13 +52,13 @@ public class DarculaSpinnerUI extends BasicSpinnerUI {
@Override
protected void replaceEditor(JComponent oldEditor, JComponent newEditor) {
super.replaceEditor(oldEditor, newEditor);
if (oldEditor != null) {
oldEditor.getComponents()[0].removeFocusListener(myFocusListener);
}
if (newEditor != null) {
newEditor.getComponents()[0].addFocusListener(myFocusListener);
}
super.replaceEditor(oldEditor, newEditor);
if (oldEditor != null && oldEditor.getComponents().length > 0) {
oldEditor.getComponents()[0].removeFocusListener(myFocusListener);
}
if (newEditor != null && newEditor.getComponents().length > 0) {
newEditor.getComponents()[0].addFocusListener(myFocusListener);
}
}
@Override

Loading…
Cancel
Save