Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java	(revision 7999)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java	(revision 8000)
@@ -18,5 +18,5 @@
 /**
  * Subclass of {@link JTextField} that:<ul>
- * <li>adds a "native" context menu (cut/copy/paste/select all)</li>
+ * <li>adds a "native" context menu (undo/cut/copy/paste/select all)</li>
  * <li>adds an optional "hint" displayed when no text has been entered</li>
  * <li>disables the global advanced key press detector when focused</li>
Index: trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 7999)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 8000)
@@ -4,5 +4,7 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -13,4 +15,5 @@
 import javax.swing.JMenuItem;
 import javax.swing.JPopupMenu;
+import javax.swing.KeyStroke;
 import javax.swing.event.UndoableEditEvent;
 import javax.swing.event.UndoableEditListener;
@@ -37,4 +40,6 @@
 public class TextContextualPopupMenu extends JPopupMenu {
 
+    private static final String EDITABLE = "editable";
+
     protected JTextComponent component = null;
     protected UndoAction undoAction = null;
@@ -42,5 +47,5 @@
     protected final PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
         @Override public void propertyChange(PropertyChangeEvent evt) {
-            if ("editable".equals(evt.getPropertyName())) {
+            if (EDITABLE.equals(evt.getPropertyName())) {
                 removeAll();
                 addMenuEntries();
@@ -68,7 +73,9 @@
                 undoAction = new UndoAction();
                 component.getDocument().addUndoableEditListener(undoAction);
+                component.getInputMap().put(
+                        KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), undoAction);
             }
             addMenuEntries();
-            component.addPropertyChangeListener("editable", propertyChangeListener);
+            component.addPropertyChangeListener(EDITABLE, propertyChangeListener);
         }
         return this;
@@ -97,5 +104,5 @@
     protected TextContextualPopupMenu detach() {
         if (isAttached()) {
-            component.removePropertyChangeListener("editable", propertyChangeListener);
+            component.removePropertyChangeListener(EDITABLE, propertyChangeListener);
             removeAll();
             if (undoAction != null) {
@@ -161,4 +168,7 @@
         private final UndoManager undoManager = new UndoManager();
 
+        /**
+         * Constructs a new {@code UndoAction}.
+         */
         public UndoAction() {
             super(tr("Undo"));
@@ -177,5 +187,7 @@
                 undoManager.undo();
             } catch (CannotUndoException ex) {
-                // Ignored
+                if (Main.isTraceEnabled()) {
+                    Main.trace(ex.getMessage());
+                }
             } finally {
                 setEnabled(undoManager.canUndo());
