Index: src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
===================================================================
--- src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 16603)
+++ src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(working copy)
@@ -264,6 +264,7 @@
         colorEdit = new JButton(tr("Choose"));
         colorEdit.addActionListener(e -> {
             int sel = colors.getSelectedRow();
+            if (sel < 0) return;
             sel = colors.convertRowIndexToModel(sel);
             ColorEntry ce = tableModel.getEntry(sel);
             JColorChooser chooser = new JColorChooser(ce.getDisplayColor());
@@ -273,7 +274,8 @@
                     JOptionPane.OK_CANCEL_OPTION,
                     JOptionPane.PLAIN_MESSAGE);
             if (answer == JOptionPane.OK_OPTION) {
-                colors.setValueAt(chooser.getColor(), sel, 1);
+                ce.info.setValue(chooser.getColor());
+                tableModel.fireTableRowsUpdated(sel, sel);
             }
         });
         defaultSet = new JButton(tr("Reset to default"));
@@ -283,7 +285,8 @@
             ColorEntry ce = tableModel.getEntry(sel);
             Color c = ce.info.getDefaultValue();
             if (c != null) {
-                colors.setValueAt(c, sel, 1);
+                ce.info.setValue(c);
+                tableModel.fireTableRowsUpdated(sel, sel);
             }
         });
         JButton defaultAll = new JButton(tr("Set all to default"));
@@ -293,7 +296,8 @@
                 ColorEntry ce = data.get(i);
                 Color c = ce.info.getDefaultValue();
                 if (c != null) {
-                    colors.setValueAt(c, i, 1);
+                    ce.info.setValue(c);
+                    tableModel.fireTableDataChanged();
                 }
             }
         });
