mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 15:20:47 +00:00
Fixed Raw editor does not select item in enum list
This commit is contained in:
@@ -90,7 +90,13 @@ public class EnumEditor extends JComboBox<ComboBoxItem<Integer>> implements Gene
|
||||
public void reset() {
|
||||
try {
|
||||
int value = (int) (Integer) ReflectionTools.getValue(obj, field, index);
|
||||
setSelectedItem(values.get(value));
|
||||
for (int i = 0; i < getItemCount(); i++) {
|
||||
ComboBoxItem<Integer> item = getItemAt(i);
|
||||
if (item.getValue() == value) {
|
||||
setSelectedItem(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user