- Fix ListChooser to accept -1 as a valid max choice number (used e.g. by Dev Mode)

This commit is contained in:
Michael Kamensky
2021-02-28 07:29:31 +03:00
parent 68bbfabc56
commit dc26f99309

View File

@@ -287,7 +287,7 @@ public class ListChooser<T> {
@Override @Override
public void valueChanged(final ListSelectionEvent e) { public void valueChanged(final ListSelectionEvent e) {
final int num = ListChooser.this.lstChoices.getSelectedIndices().length; final int num = ListChooser.this.lstChoices.getSelectedIndices().length;
ListChooser.this.optionPane.setButtonEnabled(0, (num >= ListChooser.this.minChoices) && (num <= ListChooser.this.maxChoices)); ListChooser.this.optionPane.setButtonEnabled(0, (num >= ListChooser.this.minChoices) && (num <= ListChooser.this.maxChoices || ListChooser.this.maxChoices == -1));
} }
} }