Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 735)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 736)
@@ -54,5 +54,5 @@
 			URL elemStylesPath = Main.class.getResource("/styles/"+styleName+"/elemstyles.xml");
 
-			System.out.println("mappaint: Using jar's elemstyles.xml: \"" + elemStylesPath + "\"");
+//			System.out.println("mappaint: Using jar's elemstyles.xml: \"" + elemStylesPath + "\"");
 			if (elemStylesPath != null)
 			{
Index: trunk/src/org/openstreetmap/josm/tools/AutoCompleteComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/AutoCompleteComboBox.java	(revision 735)
+++ trunk/src/org/openstreetmap/josm/tools/AutoCompleteComboBox.java	(revision 736)
@@ -19,5 +19,5 @@
 	/**
 	 * Auto-complete a JComboBox.
-	 * 
+	 *
 	 * Inspired by http://www.orbital-computer.de/JComboBox/
 	 */
@@ -37,27 +37,32 @@
 
 		@Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
+			if(selecting || (offs == 0 && str.equals(getText(0, getLength()))))
+				return;
 			super.insertString(offs, str, a);
 
 			// return immediately when selecting an item
-			// Nota: this is done after calling super method because we need
+			// Note: this is done after calling super method because we need
 			// ActionListener informed
 			if (selecting)
 				return;
 
+			int size = getLength();
+			String curText = getText(0, size);
 			// lookup and select a matching item
-			Object item = lookupItem(getText(0, getLength()));
+			Object item = lookupItem(curText);
 			if (item != null) {
-				// remove all text and insert the completed string
-				super.remove(0, getLength());
-				super.insertString(0, item.toString(), a);
-
+				String newText = item.toString();
+				if(!newText.equals(curText))
+				{
+					selecting = true;
+					super.remove(0, size);
+					super.insertString(0, newText, a);
+					selecting = false;
+					JTextComponent editor = (JTextComponent)comboBox.getEditor().getEditorComponent();
+					editor.setSelectionStart(size);
+					editor.setSelectionEnd(getLength());
+				}
 			}
-			
 			setSelectedItem(item);
-			
-			// select the completed part
-			JTextComponent editor = (JTextComponent)comboBox.getEditor().getEditorComponent();
-			editor.setSelectionStart(offs + str.length());
-			editor.setSelectionEnd(getLength());
 		}
 
