Index: /trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 13428)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 13429)
@@ -257,4 +257,5 @@
                     });
             this.list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+            this.list.setAutoCreateRowSorter(true);
             this.list.setRowSelectionAllowed(true);
             this.list.setColumnSelectionAllowed(false);
@@ -269,5 +270,5 @@
                 return null; //nothing selected
             }
-            Layer selectedLayer = layers.get(index).getValue().get(0);
+            Layer selectedLayer = layers.get(list.convertRowIndexToModel(index)).getValue().get(0);
             return new WMTSDefaultLayer(selectedLayer.identifier, selectedLayer.tileMatrixSet.identifier);
         }
