Index: src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(Arbeitskopie)
@@ -58,7 +58,7 @@
 import javax.swing.JScrollPane;
 import javax.swing.JSeparator;
 import javax.swing.JTable;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.JToolBar;
 import javax.swing.KeyStroke;
 import javax.swing.ListCellRenderer;
@@ -91,6 +91,7 @@
 import org.openstreetmap.josm.tools.LanguageInfo;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
+import org.openstreetmap.josm.gui.MyTextField;
 
 public abstract class SourceEditor extends JPanel {
 
@@ -679,8 +680,8 @@
 
     protected class EditSourceEntryDialog extends ExtendedDialog {
 
-        private JTextField tfTitle;
-        private JTextField tfURL;
+        private MyTextField tfTitle;
+        private MyTextField tfURL;
         private JCheckBox cbActive;
 
         public EditSourceEntryDialog(Component parent, String title, SourceEntry e) {
@@ -690,11 +691,11 @@
 
             JPanel p = new JPanel(new GridBagLayout());
 
-            tfTitle = new JTextField(60);
+            tfTitle = new MyTextField(60);
             p.add(new JLabel(tr("Name (optional):")), GBC.std().insets(15, 0, 5, 5));
             p.add(tfTitle, GBC.eol().insets(0, 0, 5, 5));
 
-            tfURL = new JTextField(60);
+            tfURL = new MyTextField(60);
             p.add(new JLabel(tr("URL / File:")), GBC.std().insets(15, 0, 5, 0));
             p.add(tfURL, GBC.std().insets(0, 0, 5, 5));
             JButton fileChooser = new JButton(new LaunchFileChooserAction());
@@ -1324,7 +1325,7 @@
     }
 
     class FileOrUrlCellEditor extends JPanel implements TableCellEditor {
-        private JTextField tfFileName;
+        private MyTextField tfFileName;
         private CopyOnWriteArrayList<CellEditorListener> listeners;
         private String value;
         private boolean isFile;
@@ -1340,7 +1341,7 @@
             gc.fill = GridBagConstraints.BOTH;
             gc.weightx = 1.0;
             gc.weighty = 1.0;
-            add(tfFileName = new JTextField(), gc);
+            add(tfFileName = new MyTextField(), gc);
 
             gc.gridx = 1;
             gc.gridy = 0;
Index: src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- src/org/openstreetmap/josm/gui/MapStatus.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/MapStatus.java	(Arbeitskopie)
@@ -33,7 +33,7 @@
 import javax.swing.JPanel;
 import javax.swing.JProgressBar;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.Popup;
 import javax.swing.PopupFactory;
 import javax.swing.UIManager;
@@ -49,6 +49,7 @@
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * A component that manages some status information display about the map.
@@ -150,7 +151,7 @@
 
     final ImageLabel lonText = new ImageLabel("lon", tr("The geographic longitude at the mouse pointer."), 11);
     final ImageLabel nameText = new ImageLabel("name", tr("The name of the object at the mouse pointer."), 20);
-    final JTextField helpText = new JTextField();
+    final MyTextField helpText = new MyTextField();
     final ImageLabel latText = new ImageLabel("lat", tr("The geographic latitude at the mouse pointer."), 11);
     final ImageLabel angleText = new ImageLabel("angle", tr("The angle between the previous and the current way segment."), 6);
     final ImageLabel headingText = new ImageLabel("heading", tr("The (compass) heading of the line segment being drawn."), 6);
Index: src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java
===================================================================
--- src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java	(Arbeitskopie)
@@ -1,9 +1,10 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.widgets;
 
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.text.JTextComponent;
 
+import org.openstreetmap.josm.gui.MyTextField;
 import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -12,7 +13,7 @@
  * @param <T> The ID validator class
  * @since 5765
  */
-public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends JTextField {
+public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends MyTextField {
 
     protected final T validator;
 
Index: src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java
===================================================================
--- src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java	(Arbeitskopie)
@@ -11,7 +11,7 @@
 import javax.swing.Action;
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.text.Document;
 
@@ -19,6 +19,7 @@
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * A JTextField that disabled all JOSM shortcuts composed of a single key without modifier (except F1 to F12),
@@ -26,7 +27,7 @@
  * This allows to include text fields in toggle dialogs (needed for relation filter).
  * @since 5696
  */
-public class DisableShortcutsOnFocusGainedTextField extends JTextField implements FocusListener {
+public class DisableShortcutsOnFocusGainedTextField extends MyTextField implements FocusListener {
 
     /**
      * Constructs a new <code>TextField</code>.  A default model is created,
Index: src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java
===================================================================
--- src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java	(Arbeitskopie)
@@ -10,7 +10,7 @@
 import java.beans.PropertyChangeListener;
 
 import javax.swing.BorderFactory;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.UIManager;
 import javax.swing.border.Border;
 import javax.swing.event.DocumentEvent;
@@ -19,6 +19,7 @@
 
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * This is an abstract class for a validator on a text component.
@@ -109,8 +110,8 @@
             tc.getDocument().addDocumentListener(this);
         }
         if (addActionListener) {
-            if (tc instanceof JTextField) {
-                JTextField tf = (JTextField)tc;
+            if (tc instanceof MyTextField) {
+                MyTextField tf = (MyTextField)tc;
                 tf.addActionListener(this);
             }
         }
Index: src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java
===================================================================
--- src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java	(Arbeitskopie)
@@ -18,7 +18,7 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 import javax.swing.text.JTextComponent;
@@ -31,6 +31,7 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.OsmUrlToBounds;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  *
@@ -38,14 +39,14 @@
  */
 public class BoundingBoxSelectionPanel extends JPanel {
 
-    private JTextField[] tfLatLon = null;
-    private final JTextField tfOsmUrl = new JTextField();
+    private MyTextField[] tfLatLon = null;
+    private final MyTextField tfOsmUrl = new MyTextField();
 
     protected void buildInputFields() {
-        tfLatLon = new JTextField[4];
+        tfLatLon = new MyTextField[4];
         for(int i=0; i< 4; i++) {
-            tfLatLon[i] = new JTextField(11);
-            tfLatLon[i].setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height));
+            tfLatLon[i] = new MyTextField(11);
+            tfLatLon[i].setMinimumSize(new Dimension(100,new MyTextField().getMinimumSize().height));
             SelectAllOnFocusGainedDecorator.decorate(tfLatLon[i]);
         }
         LatitudeValidator.decorate(tfLatLon[0]);
Index: src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
===================================================================
--- src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(Arbeitskopie)
@@ -32,7 +32,7 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JSpinner;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.SpinnerNumberModel;
 import javax.swing.event.ChangeEvent;
@@ -49,6 +49,7 @@
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * TileSelectionBBoxChooser allows to select a bounding box (i.e. for downloading) based
@@ -209,10 +210,10 @@
     static private class TileGridInputPanel extends JPanel implements PropertyChangeListener{
         static public final String TILE_BOUNDS_PROP = TileGridInputPanel.class.getName() + ".tileBounds";
 
-        private JTextField tfMaxY;
-        private JTextField tfMinY;
-        private JTextField tfMaxX;
-        private JTextField tfMinX;
+        private MyTextField tfMaxY;
+        private MyTextField tfMinY;
+        private MyTextField tfMaxX;
+        private MyTextField tfMinX;
         private TileCoordinateValidator valMaxY;
         private TileCoordinateValidator valMinY;
         private TileCoordinateValidator valMaxX;
@@ -266,7 +267,7 @@
 
             gc.gridx = 1;
             gc.weightx = 0.5;
-            pnl.add(tfMinX = new JTextField(), gc);
+            pnl.add(tfMinX = new MyTextField(), gc);
             valMinX = new TileCoordinateValidator(tfMinX);
             SelectAllOnFocusGainedDecorator.decorate(tfMinX);
             tfMinX.addActionListener(tileBoundsBuilder);
@@ -274,7 +275,7 @@
 
             gc.gridx = 2;
             gc.weightx = 0.5;
-            pnl.add(tfMaxX = new JTextField(), gc);
+            pnl.add(tfMaxX = new MyTextField(), gc);
             valMaxX = new TileCoordinateValidator(tfMaxX);
             SelectAllOnFocusGainedDecorator.decorate(tfMaxX);
             tfMaxX.addActionListener(tileBoundsBuilder);
@@ -287,7 +288,7 @@
 
             gc.gridx = 1;
             gc.weightx = 0.5;
-            pnl.add(tfMinY = new JTextField(), gc);
+            pnl.add(tfMinY = new MyTextField(), gc);
             valMinY = new TileCoordinateValidator(tfMinY);
             SelectAllOnFocusGainedDecorator.decorate(tfMinY);
             tfMinY.addActionListener(tileBoundsBuilder);
@@ -295,7 +296,7 @@
 
             gc.gridx = 2;
             gc.weightx = 0.5;
-            pnl.add(tfMaxY = new JTextField(), gc);
+            pnl.add(tfMaxY = new MyTextField(), gc);
             valMaxY = new TileCoordinateValidator(tfMaxY);
             SelectAllOnFocusGainedDecorator.decorate(tfMaxY);
             tfMaxY.addActionListener(tileBoundsBuilder);
@@ -427,7 +428,7 @@
 
         static public final String TILE_BOUNDS_PROP = TileAddressInputPanel.class.getName() + ".tileBounds";
 
-        private JTextField tfTileAddress;
+        private MyTextField tfTileAddress;
         private TileAddressValidator valTileAddress;
 
         protected JPanel buildTextPanel() {
@@ -451,7 +452,7 @@
 
             gc.weightx = 1.0;
             gc.gridx = 1;
-            pnl.add(tfTileAddress = new JTextField(), gc);
+            pnl.add(tfTileAddress = new MyTextField(), gc);
             valTileAddress = new TileAddressValidator(tfTileAddress);
             SelectAllOnFocusGainedDecorator.decorate(tfTileAddress);
 
Index: src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java
===================================================================
--- src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java	(Arbeitskopie)
@@ -7,21 +7,23 @@
 
 import javax.swing.AbstractCellEditor;
 import javax.swing.JTable;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.table.TableCellEditor;
 
 import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.gui.MyTextField;
 
+
 /**
  * {@link TableCellEditor} for the role column in a table for {@link RelationMember}s.
  *
  */
 public class RelationMemberTableCellEditor extends AbstractCellEditor implements TableCellEditor{
 
-    private final JTextField editor;
+    private final MyTextField editor;
 
     public RelationMemberTableCellEditor() {
-        editor = new JTextField();
+        editor = new MyTextField();
         editor.addFocusListener(
                 new FocusAdapter() {
                     @Override
Index: src/org/openstreetmap/josm/gui/download/PlaceSelection.java
===================================================================
--- src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(Arbeitskopie)
@@ -60,6 +60,7 @@
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
+import org.openstreetmap.josm.gui.MyTextField;
 
 public class PlaceSelection implements DownloadSelection {
     private static final String HISTORY_KEY = "download.places.history";
Index: src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java	(Arbeitskopie)
@@ -21,7 +21,7 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.border.EtchedBorder;
 import javax.swing.plaf.basic.BasicComboBoxEditor;
@@ -35,6 +35,7 @@
 import org.openstreetmap.josm.gui.widgets.OsmIdTextField;
 import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * Dialog prompt to user to let him choose OSM primitives to download by specifying their type and IDs
@@ -81,7 +82,7 @@
         
         cbId.setEditor(new BasicComboBoxEditor() {
             @Override
-            protected JTextField createEditorComponent() {
+            protected MyTextField createEditorComponent() {
                 return tfId;
             }
         });
Index: src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
===================================================================
--- src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java	(Arbeitskopie)
@@ -23,7 +23,7 @@
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JTextArea;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.UIManager;
 import javax.swing.border.Border;
 import javax.swing.event.DocumentEvent;
@@ -37,6 +37,7 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.OsmUrlToBounds;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * Bounding box selector.
@@ -48,7 +49,7 @@
  */
 public class BoundingBoxSelection implements DownloadSelection {
 
-    private JTextField[] latlon = null;
+    private MyTextField[] latlon = null;
     private final JTextArea tfOsmUrl = new JTextArea();
     private final JTextArea showUrl = new JTextArea();
     private DownloadDialog parent;
@@ -62,10 +63,10 @@
     }
 
     protected void buildDownloadAreaInputFields() {
-        latlon = new JTextField[4];
+        latlon = new MyTextField[4];
         for(int i=0; i< 4; i++) {
-            latlon[i] = new JTextField(11);
-            latlon[i].setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height));
+            latlon[i] = new MyTextField(11);
+            latlon[i].setMinimumSize(new Dimension(100,new MyTextField().getMinimumSize().height));
             latlon[i].addFocusListener(new SelectAllOnFocusHandler(latlon[i]));
         }
         LatValueChecker latChecker = new LatValueChecker(latlon[0]);
@@ -190,7 +191,7 @@
         latlon[1].setText(area.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES));
         latlon[2].setText(area.getMax().latToString(CoordinateFormat.DECIMAL_DEGREES));
         latlon[3].setText(area.getMax().lonToString(CoordinateFormat.DECIMAL_DEGREES));
-        for (JTextField tf: latlon) {
+        for (MyTextField tf: latlon) {
             resetErrorMessage(tf);
         }
     }
@@ -202,20 +203,20 @@
 
     private Border errorBorder = BorderFactory.createLineBorder(Color.RED, 1);
 
-    protected void setErrorMessage(JTextField tf, String msg) {
+    protected void setErrorMessage(MyTextField tf, String msg) {
         tf.setBorder(errorBorder);
         tf.setToolTipText(msg);
     }
 
-    protected void resetErrorMessage(JTextField tf) {
+    protected void resetErrorMessage(MyTextField tf) {
         tf.setBorder(UIManager.getBorder("TextField.border"));
         tf.setToolTipText("");
     }
 
     class LatValueChecker extends FocusAdapter implements ActionListener{
-        private JTextField tfLatValue;
+        private MyTextField tfLatValue;
 
-        public LatValueChecker(JTextField tfLatValue) {
+        public LatValueChecker(MyTextField tfLatValue) {
             this.tfLatValue = tfLatValue;
         }
 
@@ -245,9 +246,9 @@
     }
 
     class LonValueChecker extends FocusAdapter implements ActionListener {
-        private JTextField tfLonValue;
+        private MyTextField tfLonValue;
 
-        public LonValueChecker(JTextField tfLonValue) {
+        public LonValueChecker(MyTextField tfLonValue) {
             this.tfLonValue = tfLonValue;
         }
 
Index: src/org/openstreetmap/josm/gui/MainApplet.java
===================================================================
--- src/org/openstreetmap/josm/gui/MainApplet.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/MainApplet.java	(Arbeitskopie)
@@ -22,7 +22,7 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JPasswordField;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
@@ -32,6 +32,7 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.I18n;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.gui.MyTextField;
 
 public class MainApplet extends JApplet {
 
@@ -112,7 +113,7 @@
                 JPanel p = new JPanel(new GridBagLayout());
                 p.add(new JLabel(tr(e.realm)), GBC.eol().fill(GBC.HORIZONTAL));
                 p.add(new JLabel(tr("Username")), GBC.std().insets(0,0,20,0));
-                JTextField user = new JTextField(username == null ? "" : username);
+                MyTextField user = new MyTextField(username == null ? "" : username);
                 p.add(user, GBC.eol().fill(GBC.HORIZONTAL));
                 p.add(new JLabel(tr("Password")), GBC.std().insets(0,0,20,0));
                 JPasswordField pass = new JosmPasswordField(password == null ? "" : password);
Index: src/org/openstreetmap/josm/gui/MyTextField.java
===================================================================
--- src/org/openstreetmap/josm/gui/MyTextField.java	(Revision 0)
+++ src/org/openstreetmap/josm/gui/MyTextField.java	(Revision 0)
@@ -0,0 +1,104 @@
+package org.openstreetmap.josm.gui;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.text.*;
+import javax.swing.undo.*;
+
+public class MyTextField extends JTextField {
+    private JPopupMenu contextMenu;
+    private UndoManager undoManager;
+
+    public MyTextField(Document doc, String text, int columns){
+        super(doc, text, columns);
+        init();
+    }
+
+    public MyTextField(String text, int columns){
+        super(text, columns);
+        init();
+    }
+
+    public MyTextField(String text){
+        super(text);
+        init();
+    }
+
+    public MyTextField(int columns){
+        super(columns);
+        init();
+    }
+    
+    public MyTextField() {
+        super();
+        init();
+    }
+
+    private void init(){
+	undoManager = new UndoManager();
+	contextMenu = new JPopupMenu();
+	UndoAction undoAction = new UndoAction();
+	addToContextMenu("Paste",      DefaultEditorKit.pasteAction);
+	contextMenu.addSeparator();
+	contextMenu.add(new JMenuItem(undoAction));
+	getDocument().addUndoableEditListener(undoAction);
+	contextMenu.addSeparator();
+	addToContextMenu("Cut",        DefaultEditorKit.cutAction);
+	addToContextMenu("Copy",       DefaultEditorKit.copyAction);
+	addToContextMenu("Delete",     DefaultEditorKit.deleteNextCharAction);
+	contextMenu.addSeparator();
+	addToContextMenu("Select All", DefaultEditorKit.selectAllAction);
+
+	addMouseListener(new MouseAdapter() {
+	    public void mousePressed(MouseEvent e) {
+		if (e.getButton() == MouseEvent.BUTTON3) {
+		    contextMenu.show(MyTextField.this, e.getX(), e.getY());
+		}
+	    }
+	});
+    }
+
+    private void addToContextMenu(String label, String actionName) {
+	Action action = getActionMap().get(actionName);
+	if (action != null) {
+	    JMenuItem mi = new JMenuItem(action);
+	    mi.setText(label);
+	    contextMenu.add(mi);
+	}
+    }
+
+
+    class UndoAction extends AbstractAction implements UndoableEditListener {
+        public UndoAction() {
+            super("Undo");
+            setEnabled(false);
+        }
+          
+        public void undoableEditHappened(UndoableEditEvent e) {
+            undoManager.addEdit(e.getEdit());
+	    setEnabled(undoManager.canUndo());
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            try {
+                undoManager.undo();
+            } catch (CannotUndoException ex) {
+            }
+	    setEnabled(undoManager.canUndo());
+        }
+    }    
+
+/*
+   public static void main(String[] args) {
+	JFrame frame = new JFrame();
+	JTextField tf = new MyTextField();
+	frame.getContentPane().add(tf);
+	frame.pack();
+	frame.setLocation(200, 200);
+	frame.setVisible(true);
+    }
+*/
+}
Index: src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java	(Arbeitskopie)
@@ -30,7 +30,7 @@
 import javax.swing.JList;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 
@@ -49,7 +49,9 @@
 import org.openstreetmap.josm.gui.tagging.TaggingPreset.PresetType;
 import org.openstreetmap.josm.gui.tagging.TaggingPreset.Role;
 import org.openstreetmap.josm.gui.tagging.TaggingPreset.Roles;
+import org.openstreetmap.josm.gui.MyTextField;
 
+
 public class TaggingPresetSearchDialog extends ExtendedDialog implements SelectionChangedListener {
 
     private static final int CLASSIFICATION_IN_FAVORITES = 300;
@@ -191,7 +193,7 @@
         return instance;
     }
 
-    private JTextField edSearchText;
+    private MyTextField edSearchText;
     private JList lsResult;
     private JCheckBox ckOnlyApplicable;
     private JCheckBox ckSearchInTags;
@@ -238,7 +240,7 @@
         JPanel content = new JPanel();
         content.setLayout(new BorderLayout());
 
-        edSearchText = new JTextField();
+        edSearchText = new MyTextField();
         edSearchText.getDocument().addDocumentListener(new DocumentListener() {
 
             @Override
Index: src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
===================================================================
--- src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java	(Arbeitskopie)
@@ -10,7 +10,7 @@
 
 import javax.swing.ComboBoxEditor;
 import javax.swing.JTable;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.event.CellEditorListener;
 import javax.swing.table.TableCellEditor;
 import javax.swing.text.AttributeSet;
@@ -21,7 +21,9 @@
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.util.TableCellEditorSupport;
+import org.openstreetmap.josm.gui.MyTextField;
 
+
 /**
  * AutoCompletingTextField is an text field with autocompletion behaviour. It
  * can be used as table cell editor in {@link JTable}s.
@@ -31,7 +33,7 @@
  *
  *
  */
-public class AutoCompletingTextField extends JTextField implements ComboBoxEditor, TableCellEditor {
+public class AutoCompletingTextField extends MyTextField implements ComboBoxEditor, TableCellEditor {
 
     private Integer maxChars;
     
Index: src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
===================================================================
--- src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(Arbeitskopie)
@@ -45,7 +45,7 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.JToggleButton;
 import javax.swing.ListCellRenderer;
 import javax.swing.ListModel;
@@ -91,7 +91,9 @@
 import org.openstreetmap.josm.tools.template_engine.TemplateEntry;
 import org.openstreetmap.josm.tools.template_engine.TemplateParser;
 import org.xml.sax.SAXException;
+import org.openstreetmap.josm.gui.MyTextField;
 
+
 /**
  * This class read encapsulate one tagging preset. A class method can
  * read in all predefined presets, either shipped with JOSM or that are
@@ -521,8 +523,8 @@
         private static String getValue(Component comp) {
             if (comp instanceof JosmComboBox) {
                 return ((JosmComboBox) comp).getEditor().getItem().toString();
-            } else if (comp instanceof JTextField) {
-                return ((JTextField) comp).getText();
+            } else if (comp instanceof MyTextField) {
+                return ((MyTextField) comp).getText();
             } else if (comp instanceof JPanel) {
                 return getValue(((JPanel)comp).getComponent(0));
             } else {
Index: src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java	(Arbeitskopie)
@@ -25,13 +25,15 @@
 import javax.swing.JPanel;
 import javax.swing.JSeparator;
 import javax.swing.JTabbedPane;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.UIManager;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 
+import org.openstreetmap.josm.gui.MyTextField;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.CoordinateFormat;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -46,7 +48,7 @@
     private static final Color BG_COLOR_ERROR = new Color(255,224,224);
 
     public JTabbedPane tabs;
-    private JTextField tfLatLon, tfEastNorth;
+    private MyTextField tfLatLon, tfEastNorth;
     private LatLon latLonCoordinates;
     private EastNorth eastNorthCoordinates;
 
@@ -76,7 +78,7 @@
         pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
 
         pnl.add(new JLabel(tr("Coordinates:")), GBC.std().insets(0,10,5,0));
-        tfLatLon = new JTextField(24);
+        tfLatLon = new MyTextField(24);
         pnl.add(tfLatLon, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0));
 
         pnl.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0,5,0,5));
@@ -128,7 +130,7 @@
         pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
 
         pnl.add(new JLabel(tr("Projected coordinates:")), GBC.std().insets(0,10,5,0));
-        tfEastNorth = new JTextField(24);
+        tfEastNorth = new MyTextField(24);
 
         pnl.add(tfEastNorth, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0));
 
@@ -207,13 +209,13 @@
         return eastNorthCoordinates;
     }
 
-    protected void setErrorFeedback(JTextField tf, String message) {
+    protected void setErrorFeedback(MyTextField tf, String message) {
         tf.setBorder(BorderFactory.createLineBorder(Color.RED, 1));
         tf.setToolTipText(message);
         tf.setBackground(BG_COLOR_ERROR);
     }
 
-    protected void clearErrorFeedback(JTextField tf, String message) {
+    protected void clearErrorFeedback(MyTextField tf, String message) {
         tf.setBorder(UIManager.getBorder("TextField.border"));
         tf.setToolTipText(message);
         tf.setBackground(UIManager.getColor("TextField.background"));
@@ -328,8 +330,8 @@
     static class TextFieldFocusHandler implements FocusListener {
         public void focusGained(FocusEvent e) {
             Component c = e.getComponent();
-            if (c instanceof JTextField) {
-                JTextField tf = (JTextField)c;
+            if (c instanceof MyTextField) {
+                MyTextField tf = (MyTextField)c;
                 tf.selectAll();
             }
         }
Index: src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(Arbeitskopie)
@@ -15,7 +15,7 @@
 import javax.swing.BorderFactory;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 import javax.swing.event.HyperlinkEvent;
@@ -26,11 +26,12 @@
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlException;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.MyTextField;
 
 
 public class UrlBasedQueryPanel extends JPanel {
 
-    private JTextField tfUrl;
+    private MyTextField tfUrl;
     private JLabel lblValid;
 
     protected JPanel buildURLPanel() {
@@ -44,7 +45,7 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
         gc.fill = GridBagConstraints.HORIZONTAL;
-        pnl.add(tfUrl = new JTextField(), gc);
+        pnl.add(tfUrl = new MyTextField(), gc);
         tfUrl.getDocument().addDocumentListener(new ChangetQueryUrlValidator());
         tfUrl.addFocusListener(
                 new FocusAdapter() {
Index: src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java	(Arbeitskopie)
@@ -24,7 +24,7 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.text.JTextComponent;
 
 import org.openstreetmap.josm.Main;
@@ -38,7 +38,9 @@
 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
 import org.openstreetmap.josm.io.ChangesetQuery;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.gui.MyTextField;
 
+
 /**
  * This panel allows to specify a changeset query
  *
@@ -374,9 +376,9 @@
         private JRadioButton rbRestrictToMyself;
         private JRadioButton rbRestrictToUid;
         private JRadioButton rbRestrictToUserName;
-        private JTextField tfUid;
+        private MyTextField tfUid;
         private UidInputFieldValidator valUid;
-        private JTextField tfUserName;
+        private MyTextField tfUserName;
         private UserNameInputValidator valUserName;
         private JMultilineLabel lblRestrictedToMyself;
 
@@ -389,7 +391,7 @@
             pnl.add(new JLabel(tr("User ID:")), gc);
 
             gc.gridx = 1;
-            pnl.add(tfUid = new JTextField(10),gc);
+            pnl.add(tfUid = new MyTextField(10),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfUid);
             valUid = UidInputFieldValidator.decorate(tfUid);
 
@@ -409,7 +411,7 @@
             pnl.add(new JLabel(tr("User name:")), gc);
 
             gc.gridx = 1;
-            pnl.add(tfUserName = new JTextField(10),gc);
+            pnl.add(tfUserName = new MyTextField(10),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfUserName);
             valUserName = UserNameInputValidator.decorate(tfUserName);
 
@@ -634,17 +636,17 @@
 
         private JRadioButton rbClosedAfter;
         private JRadioButton rbClosedAfterAndCreatedBefore;
-        private JTextField tfClosedAfterDate1;
+        private MyTextField tfClosedAfterDate1;
         private DateValidator valClosedAfterDate1;
-        private JTextField tfClosedAfterTime1;
+        private MyTextField tfClosedAfterTime1;
         private TimeValidator valClosedAfterTime1;
-        private JTextField tfClosedAfterDate2;
+        private MyTextField tfClosedAfterDate2;
         private DateValidator valClosedAfterDate2;
-        private JTextField tfClosedAfterTime2;
+        private MyTextField tfClosedAfterTime2;
         private TimeValidator valClosedAfterTime2;
-        private JTextField tfCreatedBeforeDate;
+        private MyTextField tfCreatedBeforeDate;
         private DateValidator valCreatedBeforeDate;
-        private JTextField tfCreatedBeforeTime;
+        private MyTextField tfCreatedBeforeTime;
         private TimeValidator valCreatedBeforeTime;
 
         protected JPanel buildClosedAfterInputPanel() {
@@ -657,7 +659,7 @@
 
             gc.gridx = 1;
             gc.weightx = 0.7;
-            pnl.add(tfClosedAfterDate1 = new JTextField(),gc);
+            pnl.add(tfClosedAfterDate1 = new MyTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate1);
             valClosedAfterDate1 = DateValidator.decorate(tfClosedAfterDate1);
             tfClosedAfterDate1.setToolTipText(valClosedAfterDate1.getStandardTooltipTextAsHtml());
@@ -668,7 +670,7 @@
 
             gc.gridx = 3;
             gc.weightx = 0.3;
-            pnl.add(tfClosedAfterTime1 = new JTextField(),gc);
+            pnl.add(tfClosedAfterTime1 = new MyTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime1);
             valClosedAfterTime1 = TimeValidator.decorate(tfClosedAfterTime1);
             tfClosedAfterTime1.setToolTipText(valClosedAfterTime1.getStandardTooltipTextAsHtml());
@@ -691,7 +693,7 @@
 
             gc.gridx = 2;
             gc.weightx = 0.7;
-            pnl.add(tfClosedAfterDate2 = new JTextField(),gc);
+            pnl.add(tfClosedAfterDate2 = new MyTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate2);
             valClosedAfterDate2 = DateValidator.decorate(tfClosedAfterDate2);
             tfClosedAfterDate2.setToolTipText(valClosedAfterDate2.getStandardTooltipTextAsHtml());
@@ -701,7 +703,7 @@
 
             gc.gridx = 4;
             gc.weightx = 0.3;
-            pnl.add(tfClosedAfterTime2 = new JTextField(),gc);
+            pnl.add(tfClosedAfterTime2 = new MyTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime2);
             valClosedAfterTime2 = TimeValidator.decorate(tfClosedAfterTime2);
             tfClosedAfterTime2.setToolTipText(valClosedAfterTime2.getStandardTooltipTextAsHtml());
@@ -721,7 +723,7 @@
 
             gc.gridx = 2;
             gc.weightx = 0.7;
-            pnl.add(tfCreatedBeforeDate = new JTextField(),gc);
+            pnl.add(tfCreatedBeforeDate = new MyTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeDate);
             valCreatedBeforeDate = DateValidator.decorate(tfCreatedBeforeDate);
             tfCreatedBeforeDate.setToolTipText(valCreatedBeforeDate.getStandardTooltipTextAsHtml());
@@ -732,7 +734,7 @@
 
             gc.gridx = 4;
             gc.weightx = 0.3;
-            pnl.add(tfCreatedBeforeTime = new JTextField(),gc);
+            pnl.add(tfCreatedBeforeTime = new MyTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeTime);
             valCreatedBeforeTime = TimeValidator.decorate(tfCreatedBeforeTime);
             tfCreatedBeforeTime.setToolTipText(valCreatedBeforeDate.getStandardTooltipTextAsHtml());
Index: src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java	(Arbeitskopie)
@@ -26,7 +26,7 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JTextArea;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.JToolBar;
 
 import org.openstreetmap.josm.Main;
@@ -40,7 +40,9 @@
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.MyTextField;
 
+
 /**
  * This panel displays the properties of the currently selected changeset in the
  * {@link ChangesetCacheManager}.
@@ -48,12 +50,12 @@
  */
 public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener{
 
-    private JTextField tfID;
+    private MyTextField tfID;
     private JTextArea taComment;
-    private JTextField tfOpen;
-    private JTextField tfUser;
-    private JTextField tfCreatedOn;
-    private JTextField tfClosedOn;
+    private MyTextField tfOpen;
+    private MyTextField tfUser;
+    private MyTextField tfCreatedOn;
+    private MyTextField tfClosedOn;
     private DonwloadChangesetContentAction actDownloadChangesetContent;
     private UpdateChangesetAction actUpdateChangesets;
     private RemoveFromCacheAction actRemoveFromCache;
@@ -117,7 +119,7 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.weightx = 0.0;
         gc.gridx = 1;
-        pnl.add(tfID = new JTextField(10), gc);
+        pnl.add(tfID = new MyTextField(10), gc);
         tfID.setEditable(false);
 
         //-- comment
@@ -144,7 +146,7 @@
 
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.gridx = 1;
-        pnl.add(tfOpen= new JTextField(10), gc);
+        pnl.add(tfOpen= new MyTextField(10), gc);
         tfOpen.setEditable(false);
 
         //-- Created by:
@@ -157,7 +159,7 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.weightx = 1.0;
         gc.gridx = 1;
-        pnl.add(tfUser= new JTextField(""), gc);
+        pnl.add(tfUser= new MyTextField(""), gc);
         tfUser.setEditable(false);
 
         //-- Created On:
@@ -169,7 +171,7 @@
 
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.gridx = 1;
-        pnl.add(tfCreatedOn= new JTextField(20), gc);
+        pnl.add(tfCreatedOn= new MyTextField(20), gc);
         tfCreatedOn.setEditable(false);
 
         //-- Closed On:
@@ -181,7 +183,7 @@
 
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.gridx = 1;
-        pnl.add(tfClosedOn= new JTextField(20), gc);
+        pnl.add(tfClosedOn= new MyTextField(20), gc);
         tfClosedOn.setEditable(false);
 
         return pnl;
Index: src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(Arbeitskopie)
@@ -34,7 +34,7 @@
 import javax.swing.JPopupMenu;
 import javax.swing.JSlider;
 import javax.swing.JTable;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.JViewport;
 import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
@@ -71,6 +71,7 @@
 import org.openstreetmap.josm.tools.MultikeyShortcutAction;
 import org.openstreetmap.josm.tools.MultikeyShortcutAction.MultikeyInfo;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * This is a toggle dialog which displays the list of layers. Actions allow to
@@ -193,7 +194,7 @@
         layerList.getColumnModel().getColumn(1).setPreferredWidth(16);
         layerList.getColumnModel().getColumn(1).setResizable(false);
         layerList.getColumnModel().getColumn(2).setCellRenderer(new LayerNameCellRenderer());
-        layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new JTextField()));
+        layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new MyTextField()));
         for (KeyStroke ks : new KeyStroke[] {
                 KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
                 KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK),
@@ -1008,13 +1009,13 @@
     }
 
     private static class LayerNameCellEditor extends DefaultCellEditor {
-        public LayerNameCellEditor(JTextField tf) {
+        public LayerNameCellEditor(MyTextField tf) {
             super(tf);
         }
 
         @Override
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
-            JTextField tf = (JTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
+            MyTextField tf = (MyTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
             tf.setText(value == null ? "" : ((Layer) value).getName());
             return tf;
         }
Index: src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(Revision 5838)
+++ src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(Arbeitskopie)
@@ -26,7 +26,7 @@
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
 import javax.swing.SwingUtilities;
@@ -75,6 +75,7 @@
 import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * A dialog showing all known relations, with buttons to add, edit, and
@@ -95,7 +96,7 @@
     private final JPopupMenu popupMenu = new JPopupMenu();
     private final PopupMenuHandler popupMenuHandler = new PopupMenuHandler(popupMenu);
 
-    private final JTextField filter;
+    private final MyTextField filter;
     
     // Actions
     /** the edit action */
@@ -259,8 +260,8 @@
         }
     }
 
-    private JTextField  setupFilter() {
-        final JTextField f = new DisableShortcutsOnFocusGainedTextField();
+    private MyTextField  setupFilter() {
+        final MyTextField f = new DisableShortcutsOnFocusGainedTextField();
         f.setToolTipText(tr("Relation list filter"));
         f.getDocument().addDocumentListener(new DocumentListener() {
 
Index: src/org/openstreetmap/josm/actions/RenameLayerAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/RenameLayerAction.java	(Revision 5838)
+++ src/org/openstreetmap/josm/actions/RenameLayerAction.java	(Arbeitskopie)
@@ -13,11 +13,12 @@
 import javax.swing.JCheckBox;
 import javax.swing.JDialog;
 import javax.swing.JOptionPane;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.MyTextField;
 
 /**
  * Action to rename an specific layer. Provides the option to rename the
@@ -43,7 +44,7 @@
 
     public void actionPerformed(ActionEvent e) {
         Box panel = Box.createVerticalBox();
-        final JTextField name = new JTextField(layer.getName());
+        final MyTextField name = new MyTextField(layer.getName());
         panel.add(name);
         JCheckBox filerename = new JCheckBox(tr("Also rename the file"));
         if (Main.applet) {
Index: src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(Revision 5838)
+++ src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(Arbeitskopie)
@@ -19,7 +19,7 @@
 
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
@@ -30,6 +30,7 @@
 import org.openstreetmap.josm.gui.layer.ImageryLayer;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.MyTextField;
 
 
 public class ImageryAdjustAction extends MapMode implements MouseListener, MouseMotionListener, AWTEventListener{
@@ -148,8 +149,8 @@
     }
 
     class ImageryOffsetDialog extends ExtendedDialog implements FocusListener {
-        public final JTextField tOffset = new JTextField();
-        JTextField tBookmarkName = new JTextField();
+        public final MyTextField tOffset = new MyTextField();
+        MyTextField tBookmarkName = new MyTextField();
         private boolean ignoreListener;
         public ImageryOffsetDialog() {
             super(Main.parent,
Index: src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java	(Revision 5838)
+++ src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java	(Arbeitskopie)
@@ -16,7 +16,7 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -26,6 +26,7 @@
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.UrlLabel;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.MyTextField;
 
 public class Map_Rectifier_WMSmenuAction extends JosmAction {
     /**
@@ -110,7 +111,7 @@
         JPanel panel = new JPanel(new GridBagLayout());
         panel.add(new JLabel(tr("Supported Rectifier Services:")), GBC.eol());
 
-        JTextField tfWmsUrl = new JTextField(30);
+        MyTextField tfWmsUrl = new MyTextField(30);
 
         String clip = Utils.getClipboardContent();
         clip = clip == null ? "" : clip.trim();
Index: src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/search/SearchAction.java	(Revision 5838)
+++ src/org/openstreetmap/josm/actions/search/SearchAction.java	(Arbeitskopie)
@@ -29,7 +29,7 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.text.BadLocationException;
 
 import org.openstreetmap.josm.Main;
@@ -50,7 +50,9 @@
 import org.openstreetmap.josm.tools.Property;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.MyTextField;
 
+
 public class SearchAction extends JosmAction implements ParameterizedAction {
 
     public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15;
@@ -194,7 +196,7 @@
                     @Override
                     public void mouseClicked(MouseEvent e) {
                         try {
-                            JTextField tf = (JTextField) hcb.getEditor().getEditorComponent();
+                            MyTextField tf = (MyTextField) hcb.getEditor().getEditorComponent();
                             tf.getDocument().insertString(tf.getCaretPosition(), " " + insertText, null);
                         } catch (BadLocationException ex) {
                             throw new RuntimeException(ex.getMessage(), ex);
Index: src/org/openstreetmap/josm/actions/JumpToAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/JumpToAction.java	(Revision 5838)
+++ src/org/openstreetmap/josm/actions/JumpToAction.java	(Arbeitskopie)
@@ -13,7 +13,7 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
+//import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 
@@ -24,6 +24,7 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.OsmUrlToBounds;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.gui.MyTextField;
 
 public class JumpToAction extends JosmAction implements MouseListener {
     public JumpToAction() {
@@ -33,10 +34,10 @@
         Main.toolbar.register(this);
     }
 
-    private JTextField url = new JTextField();
-    private JTextField lat = new JTextField();
-    private JTextField lon = new JTextField();
-    private JTextField zm = new JTextField();
+    private MyTextField url = new MyTextField();
+    private MyTextField lat = new MyTextField();
+    private MyTextField lon = new MyTextField();
+    private MyTextField zm = new MyTextField();
 
     private double zoomFactor = 0;
     public void showJumpToDialog() {
