Browse Source

Fix possible ArrayOutOfBoundsException in DarculaSpinnerUI.java.

Manifests itself when using Toedter JCalendar library
master
Alessandro Falappa 9 years ago
parent
commit
1f03f39dd6
  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