mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Fixed bug introduced by #2628
This commit is contained in:
parent
00941453db
commit
5687528325
@ -967,13 +967,17 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
}
|
}
|
||||||
JCheckBoxMenuItem selection = null;
|
JCheckBoxMenuItem selection = null;
|
||||||
for (int i = 0; i < serialMenu.getItemCount(); i++) {
|
for (int i = 0; i < serialMenu.getItemCount(); i++) {
|
||||||
JCheckBoxMenuItem item = ((JCheckBoxMenuItem)serialMenu.getItem(i));
|
JMenuItem menuItem = serialMenu.getItem(i);
|
||||||
if (item == null) {
|
if (!(menuItem instanceof JCheckBoxMenuItem)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
JCheckBoxMenuItem checkBoxMenuItem = ((JCheckBoxMenuItem) menuItem);
|
||||||
|
if (checkBoxMenuItem == null) {
|
||||||
System.out.println(_("name is null"));
|
System.out.println(_("name is null"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
item.setState(false);
|
checkBoxMenuItem.setState(false);
|
||||||
if (name.equals(item.getText())) selection = item;
|
if (name.equals(checkBoxMenuItem.getText())) selection = checkBoxMenuItem;
|
||||||
}
|
}
|
||||||
if (selection != null) selection.setState(true);
|
if (selection != null) selection.setState(true);
|
||||||
//System.out.println(item.getLabel());
|
//System.out.println(item.getLabel());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user