Index: /trunk/src/org/openstreetmap/josm/actions/AboutAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AboutAction.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/actions/AboutAction.java	(revision 5886)
@@ -15,9 +15,9 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
-import javax.swing.JTextArea;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.plugins.PluginHandler;
 import org.openstreetmap.josm.tools.BugReportExceptionHandler;
@@ -38,4 +38,7 @@
 public class AboutAction extends JosmAction {
 
+    /**
+     * Constructs a new {@code AboutAction}.
+     */
     public AboutAction() {
         super(tr("About"), "about", tr("Display the about screen."),
@@ -49,20 +52,20 @@
         Version version = Version.getInstance();
 
-        JTextArea readme = new JTextArea();
+        JosmTextArea readme = new JosmTextArea();
         readme.setEditable(false);
         readme.setText(Version.loadResourceFile(Main.class.getResource("/README")));
         readme.setCaretPosition(0);
 
-        JTextArea revision = new JTextArea();
+        JosmTextArea revision = new JosmTextArea();
         revision.setEditable(false);
         revision.setText(version.getReleaseAttributes());
         revision.setCaretPosition(0);
 
-        JTextArea contribution = new JTextArea();
+        JosmTextArea contribution = new JosmTextArea();
         contribution.setEditable(false);
         contribution.setText(Version.loadResourceFile(Main.class.getResource("/CONTRIBUTION")));
         contribution.setCaretPosition(0);
 
-        JTextArea license = new JTextArea();
+        JosmTextArea license = new JosmTextArea();
         license.setEditable(false);
         license.setText(Version.loadResourceFile(Main.class.getResource("/LICENSE")));
@@ -103,5 +106,5 @@
     }
 
-    private JScrollPane createScrollPane(JTextArea area) {
+    private JScrollPane createScrollPane(JosmTextArea area) {
         area.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
         area.setOpaque(false);
Index: /trunk/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java	(revision 5886)
@@ -19,5 +19,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 import javax.swing.SwingUtilities;
 
@@ -32,4 +31,5 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -43,4 +43,7 @@
 public class DownloadPrimitiveAction extends JosmAction {
 
+    /**
+     * Constructs a new {@code DownloadPrimitiveAction}.
+     */
     public DownloadPrimitiveAction() {
         super(tr("Download object..."), "downloadprimitive", tr("Download OSM object by ID."),
@@ -144,5 +147,5 @@
             p.add(missing, GBC.eol());
         }
-        JTextArea txt = new JTextArea();
+        JosmTextArea txt = new JosmTextArea();
         txt.setFont(new Font("Monospaced", txt.getFont().getStyle(), txt.getFont().getSize()));
         txt.setEditable(false);
Index: /trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 5886)
@@ -20,5 +20,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
@@ -31,4 +30,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 
@@ -149,6 +149,6 @@
 
     class ImageryOffsetDialog extends ExtendedDialog implements FocusListener {
-        public final JTextField tOffset = new JTextField();
-        JTextField tBookmarkName = new JTextField();
+        public final JosmTextField tOffset = new JosmTextField();
+        JosmTextField tBookmarkName = new JosmTextField();
         private boolean ignoreListener;
         public ImageryOffsetDialog() {
Index: /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 5886)
@@ -14,5 +14,4 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -25,6 +24,10 @@
 import org.openstreetmap.josm.tools.OsmUrlToBounds;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class JumpToAction extends JosmAction implements MouseListener {
+    /**
+     * Constructs a new {@code JumpToAction}.
+     */
     public JumpToAction() {
         super(tr("Jump To Position"), null, tr("Opens a dialog that allows to jump to a specific location"), Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump To Position")),
@@ -34,8 +37,8 @@
     }
 
-    private JTextField url = new JTextField();
-    private JTextField lat = new JTextField();
-    private JTextField lon = new JTextField();
-    private JTextField zm = new JTextField();
+    private JosmTextField url = new JosmTextField();
+    private JosmTextField lat = new JosmTextField();
+    private JosmTextField lon = new JosmTextField();
+    private JosmTextField zm = new JosmTextField();
 
     private double zoomFactor = 0;
Index: /trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java	(revision 5886)
@@ -17,5 +17,4 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
@@ -27,4 +26,5 @@
 import org.openstreetmap.josm.tools.UrlLabel;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class Map_Rectifier_WMSmenuAction extends JosmAction {
@@ -111,5 +111,5 @@
         panel.add(new JLabel(tr("Supported Rectifier Services:")), GBC.eol());
 
-        JTextField tfWmsUrl = new JTextField(30);
+        JosmTextField tfWmsUrl = new JosmTextField(30);
 
         String clip = Utils.getClipboardContent();
Index: /trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 5886)
@@ -14,9 +14,9 @@
 import javax.swing.JDialog;
 import javax.swing.JOptionPane;
-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.widgets.JosmTextField;
 
 /**
@@ -44,5 +44,5 @@
     public void actionPerformed(ActionEvent e) {
         Box panel = Box.createVerticalBox();
-        final JTextField name = new JTextField(layer.getName());
+        final JosmTextField name = new JosmTextField(layer.getName());
         panel.add(name);
         JCheckBox filerename = new JCheckBox(tr("Also rename the file"));
Index: /trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 5886)
@@ -19,5 +19,4 @@
 
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 
 import org.openstreetmap.josm.Main;
@@ -27,4 +26,5 @@
 import org.openstreetmap.josm.data.osm.DatasetConsistencyTest;
 import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.plugins.PluginHandler;
 import org.openstreetmap.josm.tools.BugReportExceptionHandler;
@@ -138,5 +138,5 @@
         }
 
-        JTextArea ta = new JTextArea(text.toString());
+        JosmTextArea ta = new JosmTextArea(text.toString());
         ta.setWrapStyleWord(true);
         ta.setLineWrap(true);
Index: /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 5886)
@@ -30,5 +30,4 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
 import javax.swing.text.BadLocationException;
 
@@ -51,4 +50,6 @@
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
+
 
 public class SearchAction extends JosmAction implements ParameterizedAction {
@@ -195,5 +196,5 @@
                     public void mouseClicked(MouseEvent e) {
                         try {
-                            JTextField tf = (JTextField) hcb.getEditor().getEditorComponent();
+                            JosmTextField tf = (JosmTextField) hcb.getEditor().getEditorComponent();
                             tf.getDocument().insertString(tf.getCaretPosition(), " " + insertText, null);
                         } catch (BadLocationException ex) {
Index: /trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/GettingStarted.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/GettingStarted.java	(revision 5886)
@@ -16,5 +16,4 @@
 
 import javax.swing.JComponent;
-import javax.swing.JEditorPane;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
@@ -26,4 +25,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Version;
+import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.io.CacheCustomContent;
 import org.openstreetmap.josm.tools.LanguageInfo;
@@ -39,5 +39,10 @@
             + "</style>\n";
 
-    public static class LinkGeneral extends JEditorPane implements HyperlinkListener {
+    public static class LinkGeneral extends JosmEditorPane implements HyperlinkListener {
+        
+        /**
+         * Constructs a new {@code LinkGeneral} with the given HTML text
+         * @param text The text to display
+         */
         public LinkGeneral(String text) {
             setContentType("text/html");
Index: /trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 5886)
@@ -17,4 +17,5 @@
 import org.openstreetmap.josm.gui.help.HelpBrowser;
 import org.openstreetmap.josm.gui.help.HelpUtil;
+import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
@@ -158,7 +159,5 @@
 
         if (msg instanceof String) {
-            JEditorPane pane = new JEditorPane();
-            pane.setContentType("text/html");
-            pane.setText((String) msg);
+            JosmEditorPane pane = new JosmEditorPane("text/html", (String) msg);
             pane.setEditable(false);
             pane.setOpaque(false);
Index: /trunk/src/org/openstreetmap/josm/gui/MainApplet.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainApplet.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/MainApplet.java	(revision 5886)
@@ -22,6 +22,4 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JPasswordField;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
@@ -30,4 +28,5 @@
 import org.openstreetmap.josm.gui.MainApplication.Option;
 import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.I18n;
@@ -114,8 +113,8 @@
                 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);
+                JosmTextField user = new JosmTextField(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);
+                JosmPasswordField pass = new JosmPasswordField(password == null ? "" : password);
                 p.add(pass, GBC.eol().fill(GBC.HORIZONTAL));
                 JOptionPane.showMessageDialog(null, p);
Index: /trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 5886)
@@ -34,5 +34,4 @@
 import javax.swing.JProgressBar;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
 import javax.swing.Popup;
 import javax.swing.PopupFactory;
@@ -50,4 +49,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -151,5 +151,5 @@
     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 JosmTextField helpText = new JosmTextField();
     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);
Index: /trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java	(revision 5886)
@@ -20,9 +20,9 @@
 import javax.swing.JProgressBar;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 import javax.swing.UIManager;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor.ProgressMonitorDialog;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -38,5 +38,5 @@
     private JButton btnInBackground;
     /** the text area and the scroll pane for the log */
-    private JTextArea taLog = new JTextArea(5,50);
+    private JosmTextArea taLog = new JosmTextArea(5,50);
     private  JScrollPane spLog;
 
Index: /trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java	(revision 5886)
@@ -24,5 +24,4 @@
 import javax.swing.BorderFactory;
 import javax.swing.JDialog;
-import javax.swing.JEditorPane;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
@@ -47,4 +46,5 @@
 import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
 import org.openstreetmap.josm.gui.help.HelpUtil;
+import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.WindowGeometry;
@@ -53,5 +53,5 @@
  * This dialog is used to get a user confirmation that a collection of primitives can be removed
  * from their parent relations.
- *
+ * @since 2308
  */
 public class DeleteFromRelationConfirmationDialog extends JDialog implements TableModelListener {
@@ -62,5 +62,5 @@
      * Replies the unique instance of this dialog
      *
-     * @return
+     * @return The unique instance of this dialog
      */
     static public DeleteFromRelationConfirmationDialog getInstance() {
@@ -73,5 +73,5 @@
     /** the data model */
     private RelationMemberTableModel model;
-    private JEditorPane jepMessage;
+    private JosmEditorPane jepMessage;
     private boolean canceled;
     private SideButton btnOK;
@@ -79,5 +79,5 @@
     protected JPanel buildMessagePanel() {
         JPanel pnl = new JPanel(new BorderLayout());
-        jepMessage = new JEditorPane("text/html", "");
+        jepMessage = new JosmEditorPane("text/html", "");
         jepMessage.setOpaque(false);
         jepMessage.setEditable(false);
@@ -169,4 +169,7 @@
     }
 
+    /**
+     * Constructs a new {@code DeleteFromRelationConfirmationDialog}.
+     */
     public DeleteFromRelationConfirmationDialog() {
         super(JOptionPane.getFrameForComponent(Main.parent), "", ModalityType.DOCUMENT_MODAL);
@@ -225,4 +228,7 @@
         private ArrayList<RelationToChildReference> data;
 
+        /**
+         * Constructs a new {@code RelationMemberTableModel}.
+         */
         public RelationMemberTableModel() {
             data = new ArrayList<RelationToChildReference>();
Index: /trunk/src/org/openstreetmap/josm/gui/actionsupport/LogShowDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/actionsupport/LogShowDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/actionsupport/LogShowDialog.java	(revision 5886)
@@ -1,16 +1,17 @@
 package org.openstreetmap.josm.gui.actionsupport;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.Dimension;
 import java.awt.GridBagLayout;
-import javax.swing.*;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
-import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference;
-import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.tools.GBC;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -34,5 +35,5 @@
         
         p.add(lbl, GBC.eol().insets(5,0,5,0));
-        JEditorPane txt = new JEditorPane();
+        JosmEditorPane txt = new JosmEditorPane();
         txt.setContentType("text/html");
         txt.setText(log);
@@ -50,4 +51,2 @@
     }
 }
- 
-
Index: /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 5886)
@@ -33,5 +33,4 @@
 import javax.swing.JPanel;
 import javax.swing.JSpinner;
-import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.SpinnerNumberModel;
@@ -50,4 +49,5 @@
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -210,8 +210,8 @@
         static public final String TILE_BOUNDS_PROP = TileGridInputPanel.class.getName() + ".tileBounds";
 
-        private JTextField tfMaxY;
-        private JTextField tfMinY;
-        private JTextField tfMaxX;
-        private JTextField tfMinX;
+        private JosmTextField tfMaxY;
+        private JosmTextField tfMinY;
+        private JosmTextField tfMaxX;
+        private JosmTextField tfMinX;
         private TileCoordinateValidator valMaxY;
         private TileCoordinateValidator valMinY;
@@ -267,5 +267,5 @@
             gc.gridx = 1;
             gc.weightx = 0.5;
-            pnl.add(tfMinX = new JTextField(), gc);
+            pnl.add(tfMinX = new JosmTextField(), gc);
             valMinX = new TileCoordinateValidator(tfMinX);
             SelectAllOnFocusGainedDecorator.decorate(tfMinX);
@@ -275,5 +275,5 @@
             gc.gridx = 2;
             gc.weightx = 0.5;
-            pnl.add(tfMaxX = new JTextField(), gc);
+            pnl.add(tfMaxX = new JosmTextField(), gc);
             valMaxX = new TileCoordinateValidator(tfMaxX);
             SelectAllOnFocusGainedDecorator.decorate(tfMaxX);
@@ -288,5 +288,5 @@
             gc.gridx = 1;
             gc.weightx = 0.5;
-            pnl.add(tfMinY = new JTextField(), gc);
+            pnl.add(tfMinY = new JosmTextField(), gc);
             valMinY = new TileCoordinateValidator(tfMinY);
             SelectAllOnFocusGainedDecorator.decorate(tfMinY);
@@ -296,5 +296,5 @@
             gc.gridx = 2;
             gc.weightx = 0.5;
-            pnl.add(tfMaxY = new JTextField(), gc);
+            pnl.add(tfMaxY = new JosmTextField(), gc);
             valMaxY = new TileCoordinateValidator(tfMaxY);
             SelectAllOnFocusGainedDecorator.decorate(tfMaxY);
@@ -428,5 +428,5 @@
         static public final String TILE_BOUNDS_PROP = TileAddressInputPanel.class.getName() + ".tileBounds";
 
-        private JTextField tfTileAddress;
+        private JosmTextField tfTileAddress;
         private TileAddressValidator valTileAddress;
 
@@ -452,5 +452,5 @@
             gc.weightx = 1.0;
             gc.gridx = 1;
-            pnl.add(tfTileAddress = new JTextField(), gc);
+            pnl.add(tfTileAddress = new JosmTextField(), gc);
             valTileAddress = new TileAddressValidator(tfTileAddress);
             SelectAllOnFocusGainedDecorator.decorate(tfTileAddress);
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java	(revision 5886)
@@ -8,8 +8,9 @@
 import javax.swing.AbstractCellEditor;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.table.TableCellEditor;
 
 import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
+
 
 /**
@@ -19,8 +20,11 @@
 public class RelationMemberTableCellEditor extends AbstractCellEditor implements TableCellEditor{
 
-    private final JTextField editor;
+    private final JosmTextField editor;
 
+    /**
+     * Constructs a new {@code RelationMemberTableCellEditor}.
+     */
     public RelationMemberTableCellEditor() {
-        editor = new JTextField();
+        editor = new JosmTextField();
         editor.addFocusListener(
                 new FocusAdapter() {
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 5886)
@@ -17,5 +17,4 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
-import javax.swing.JTextArea;
 import javax.swing.SingleSelectionModel;
 import javax.swing.event.ChangeEvent;
@@ -46,4 +45,5 @@
 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
 import org.openstreetmap.josm.gui.mappaint.xml.XmlStyleSource;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.tools.DateUtils;
 import org.openstreetmap.josm.tools.GBC;
@@ -61,6 +61,6 @@
     protected List<OsmPrimitive> primitives;
     protected OsmDataLayer layer;
-    private JTextArea txtData;
-    private JTextArea txtMappaint;
+    private JosmTextArea txtData;
+    private JosmTextArea txtMappaint;
     boolean mappaintTabLoaded;
 
@@ -94,5 +94,5 @@
     protected JPanel buildDataPanel() {
         JPanel p = new JPanel(new GridBagLayout());
-        txtData = new JTextArea();
+        txtData = new JosmTextArea();
         txtData.setFont(new Font("Monospaced", txtData.getFont().getStyle(), txtData.getFont().getSize()));
         txtData.setEditable(false);
@@ -321,5 +321,5 @@
     protected void buildMapPaintPanel(JPanel p) {
         p.setLayout(new GridBagLayout());
-        txtMappaint = new JTextArea();
+        txtMappaint = new JosmTextArea();
         txtMappaint.setFont(new Font("Monospaced", txtMappaint.getFont().getStyle(), txtMappaint.getFont().getSize()));
         txtMappaint.setEditable(false);
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java	(revision 5886)
@@ -7,9 +7,6 @@
 import java.awt.Component;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
 import java.awt.event.FocusEvent;
 import java.awt.event.FocusListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
 import java.text.NumberFormat;
 import java.text.ParsePosition;
@@ -20,5 +17,4 @@
 import java.util.regex.Pattern;
 
-import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
 import javax.swing.JLabel;
@@ -26,5 +22,4 @@
 import javax.swing.JSeparator;
 import javax.swing.JTabbedPane;
-import javax.swing.JTextField;
 import javax.swing.UIManager;
 import javax.swing.event.ChangeEvent;
@@ -39,6 +34,6 @@
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
-import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.WindowGeometry;
 
@@ -47,5 +42,5 @@
 
     public JTabbedPane tabs;
-    private JTextField tfLatLon, tfEastNorth;
+    private JosmTextField tfLatLon, tfEastNorth;
     private LatLon latLonCoordinates;
     private EastNorth eastNorthCoordinates;
@@ -77,5 +72,5 @@
 
         pnl.add(new JLabel(tr("Coordinates:")), GBC.std().insets(0,10,5,0));
-        tfLatLon = new JTextField(24);
+        tfLatLon = new JosmTextField(24);
         pnl.add(tfLatLon, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0));
 
@@ -129,5 +124,5 @@
 
         pnl.add(new JLabel(tr("Projected coordinates:")), GBC.std().insets(0,10,5,0));
-        tfEastNorth = new JTextField(24);
+        tfEastNorth = new JosmTextField(24);
 
         pnl.add(tfEastNorth, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0));
@@ -208,5 +203,5 @@
     }
 
-    protected void setErrorFeedback(JTextField tf, String message) {
+    protected void setErrorFeedback(JosmTextField tf, String message) {
         tf.setBorder(BorderFactory.createLineBorder(Color.RED, 1));
         tf.setToolTipText(message);
@@ -214,5 +209,5 @@
     }
 
-    protected void clearErrorFeedback(JTextField tf, String message) {
+    protected void clearErrorFeedback(JosmTextField tf, String message) {
         tf.setBorder(UIManager.getBorder("TextField.border"));
         tf.setToolTipText(message);
@@ -329,6 +324,6 @@
         public void focusGained(FocusEvent e) {
             Component c = e.getComponent();
-            if (c instanceof JTextField) {
-                JTextField tf = (JTextField)c;
+            if (c instanceof JosmTextField) {
+                JosmTextField tf = (JosmTextField)c;
                 tf.selectAll();
             }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 5886)
@@ -35,5 +35,4 @@
 import javax.swing.JSlider;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.JViewport;
 import javax.swing.KeyStroke;
@@ -72,4 +71,5 @@
 import org.openstreetmap.josm.tools.MultikeyShortcutAction.MultikeyInfo;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -194,5 +194,5 @@
         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 JosmTextField()));
         for (KeyStroke ks : new KeyStroke[] {
                 KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
@@ -1009,5 +1009,5 @@
 
     private static class LayerNameCellEditor extends DefaultCellEditor {
-        public LayerNameCellEditor(JTextField tf) {
+        public LayerNameCellEditor(JosmTextField tf) {
             super(tf);
         }
@@ -1015,5 +1015,5 @@
         @Override
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
-            JTextField tf = (JTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
+            JosmTextField tf = (JosmTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
             tf.setText(value == null ? "" : ((Layer) value).getName());
             return tf;
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 5886)
@@ -39,5 +39,4 @@
 import javax.swing.JTabbedPane;
 import javax.swing.JTable;
-import javax.swing.JTextArea;
 import javax.swing.JViewport;
 import javax.swing.ListSelectionModel;
@@ -72,4 +71,5 @@
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 import org.openstreetmap.josm.gui.widgets.JFileChooserManager;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.tools.GBC;
@@ -91,4 +91,7 @@
     protected JCheckBox cbWireframe;
 
+    /**
+     * Constructs a new {@code MapPaintDialog}.
+     */
     public MapPaintDialog() {
         super(tr("Map Paint Styles"), "mapstyle", tr("configure the map painting style"),
@@ -406,4 +409,7 @@
      */
     public static class LaunchMapPaintPreferencesAction extends AbstractAction {
+        /**
+         * Constructs a new {@code LaunchMapPaintPreferencesAction}.
+         */
         public LaunchMapPaintPreferencesAction() {
             putValue(NAME, tr("Preferences"));
@@ -652,5 +658,5 @@
 
         private void buildSourcePanel(StyleSource s, JPanel p) {
-            JTextArea txtSource = new JTextArea();
+            JosmTextArea txtSource = new JosmTextArea();
             txtSource.setFont(new Font("Monospaced", txtSource.getFont().getStyle(), txtSource.getFont().getSize()));
             txtSource.setEditable(false);
@@ -673,5 +679,5 @@
 
         private void buildErrorsPanel(StyleSource s, JPanel p) {
-            JTextArea txtErrors = new JTextArea();
+            JosmTextArea txtErrors = new JosmTextArea();
             txtErrors.setFont(new Font("Monospaced", txtErrors.getFont().getStyle(), txtErrors.getFont().getSize()));
             txtErrors.setEditable(false);
@@ -702,4 +708,7 @@
 
     public class MapPaintPopup extends JPopupMenu {
+        /**
+         * Constructs a new {@code MapPaintPopup}.
+         */
         public MapPaintPopup() {
             add(reloadAction);
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 5886)
@@ -27,5 +27,4 @@
 import javax.swing.JPopupMenu;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
@@ -76,4 +75,5 @@
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -96,5 +96,5 @@
     private final PopupMenuHandler popupMenuHandler = new PopupMenuHandler(popupMenu);
 
-    private final JTextField filter;
+    private final JosmTextField filter;
     
     // Actions
@@ -260,6 +260,6 @@
     }
 
-    private JTextField  setupFilter() {
-        final JTextField f = new DisableShortcutsOnFocusGainedTextField();
+    private JosmTextField  setupFilter() {
+        final JosmTextField f = new DisableShortcutsOnFocusGainedTextField();
         f.setToolTipText(tr("Relation list filter"));
         f.getDocument().addDocumentListener(new DocumentListener() {
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java	(revision 5886)
@@ -26,6 +26,4 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
 import javax.swing.JToolBar;
 
@@ -40,5 +38,8 @@
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.ImageProvider;
+
 
 /**
@@ -49,10 +50,10 @@
 public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener{
 
-    private JTextField tfID;
-    private JTextArea taComment;
-    private JTextField tfOpen;
-    private JTextField tfUser;
-    private JTextField tfCreatedOn;
-    private JTextField tfClosedOn;
+    private JosmTextField tfID;
+    private JosmTextArea taComment;
+    private JosmTextField tfOpen;
+    private JosmTextField tfUser;
+    private JosmTextField tfCreatedOn;
+    private JosmTextField tfClosedOn;
     private DonwloadChangesetContentAction actDownloadChangesetContent;
     private UpdateChangesetAction actUpdateChangesets;
@@ -118,5 +119,5 @@
         gc.weightx = 0.0;
         gc.gridx = 1;
-        pnl.add(tfID = new JTextField(10), gc);
+        pnl.add(tfID = new JosmTextField(10), gc);
         tfID.setEditable(false);
 
@@ -132,5 +133,5 @@
         gc.weighty = 1.0;
         gc.gridx = 1;
-        pnl.add(taComment= new JTextArea(5,40), gc);
+        pnl.add(taComment= new JosmTextArea(5,40), gc);
         taComment.setEditable(false);
 
@@ -145,5 +146,5 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.gridx = 1;
-        pnl.add(tfOpen= new JTextField(10), gc);
+        pnl.add(tfOpen= new JosmTextField(10), gc);
         tfOpen.setEditable(false);
 
@@ -158,5 +159,5 @@
         gc.weightx = 1.0;
         gc.gridx = 1;
-        pnl.add(tfUser= new JTextField(""), gc);
+        pnl.add(tfUser= new JosmTextField(""), gc);
         tfUser.setEditable(false);
 
@@ -170,5 +171,5 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.gridx = 1;
-        pnl.add(tfCreatedOn= new JTextField(20), gc);
+        pnl.add(tfCreatedOn= new JosmTextField(20), gc);
         tfCreatedOn.setEditable(false);
 
@@ -182,5 +183,5 @@
         gc.fill = GridBagConstraints.HORIZONTAL;
         gc.gridx = 1;
-        pnl.add(tfClosedOn= new JTextField(20), gc);
+        pnl.add(tfClosedOn= new JosmTextField(20), gc);
         tfClosedOn.setEditable(false);
 
@@ -230,4 +231,7 @@
     }
 
+    /**
+     * Constructs a new {@code ChangesetDetailPanel}.
+     */
     public ChangesetDetailPanel() {
         build();
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java	(revision 5886)
@@ -25,5 +25,4 @@
 import javax.swing.JRadioButton;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
 import javax.swing.text.JTextComponent;
 
@@ -39,4 +38,6 @@
 import org.openstreetmap.josm.io.ChangesetQuery;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
+
 
 /**
@@ -375,7 +376,7 @@
         private JRadioButton rbRestrictToUid;
         private JRadioButton rbRestrictToUserName;
-        private JTextField tfUid;
+        private JosmTextField tfUid;
         private UidInputFieldValidator valUid;
-        private JTextField tfUserName;
+        private JosmTextField tfUserName;
         private UserNameInputValidator valUserName;
         private JMultilineLabel lblRestrictedToMyself;
@@ -390,5 +391,5 @@
 
             gc.gridx = 1;
-            pnl.add(tfUid = new JTextField(10),gc);
+            pnl.add(tfUid = new JosmTextField(10),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfUid);
             valUid = UidInputFieldValidator.decorate(tfUid);
@@ -410,5 +411,5 @@
 
             gc.gridx = 1;
-            pnl.add(tfUserName = new JTextField(10),gc);
+            pnl.add(tfUserName = new JosmTextField(10),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfUserName);
             valUserName = UserNameInputValidator.decorate(tfUserName);
@@ -635,15 +636,15 @@
         private JRadioButton rbClosedAfter;
         private JRadioButton rbClosedAfterAndCreatedBefore;
-        private JTextField tfClosedAfterDate1;
+        private JosmTextField tfClosedAfterDate1;
         private DateValidator valClosedAfterDate1;
-        private JTextField tfClosedAfterTime1;
+        private JosmTextField tfClosedAfterTime1;
         private TimeValidator valClosedAfterTime1;
-        private JTextField tfClosedAfterDate2;
+        private JosmTextField tfClosedAfterDate2;
         private DateValidator valClosedAfterDate2;
-        private JTextField tfClosedAfterTime2;
+        private JosmTextField tfClosedAfterTime2;
         private TimeValidator valClosedAfterTime2;
-        private JTextField tfCreatedBeforeDate;
+        private JosmTextField tfCreatedBeforeDate;
         private DateValidator valCreatedBeforeDate;
-        private JTextField tfCreatedBeforeTime;
+        private JosmTextField tfCreatedBeforeTime;
         private TimeValidator valCreatedBeforeTime;
 
@@ -658,5 +659,5 @@
             gc.gridx = 1;
             gc.weightx = 0.7;
-            pnl.add(tfClosedAfterDate1 = new JTextField(),gc);
+            pnl.add(tfClosedAfterDate1 = new JosmTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate1);
             valClosedAfterDate1 = DateValidator.decorate(tfClosedAfterDate1);
@@ -669,5 +670,5 @@
             gc.gridx = 3;
             gc.weightx = 0.3;
-            pnl.add(tfClosedAfterTime1 = new JTextField(),gc);
+            pnl.add(tfClosedAfterTime1 = new JosmTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime1);
             valClosedAfterTime1 = TimeValidator.decorate(tfClosedAfterTime1);
@@ -692,5 +693,5 @@
             gc.gridx = 2;
             gc.weightx = 0.7;
-            pnl.add(tfClosedAfterDate2 = new JTextField(),gc);
+            pnl.add(tfClosedAfterDate2 = new JosmTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate2);
             valClosedAfterDate2 = DateValidator.decorate(tfClosedAfterDate2);
@@ -702,5 +703,5 @@
             gc.gridx = 4;
             gc.weightx = 0.3;
-            pnl.add(tfClosedAfterTime2 = new JTextField(),gc);
+            pnl.add(tfClosedAfterTime2 = new JosmTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime2);
             valClosedAfterTime2 = TimeValidator.decorate(tfClosedAfterTime2);
@@ -722,5 +723,5 @@
             gc.gridx = 2;
             gc.weightx = 0.7;
-            pnl.add(tfCreatedBeforeDate = new JTextField(),gc);
+            pnl.add(tfCreatedBeforeDate = new JosmTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeDate);
             valCreatedBeforeDate = DateValidator.decorate(tfCreatedBeforeDate);
@@ -733,5 +734,5 @@
             gc.gridx = 4;
             gc.weightx = 0.3;
-            pnl.add(tfCreatedBeforeTime = new JTextField(),gc);
+            pnl.add(tfCreatedBeforeTime = new JosmTextField(),gc);
             SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeTime);
             valCreatedBeforeTime = TimeValidator.decorate(tfCreatedBeforeTime);
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 5886)
@@ -16,5 +16,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -27,9 +26,10 @@
 import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlException;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 
 public class UrlBasedQueryPanel extends JPanel {
 
-    private JTextField tfUrl;
+    private JosmTextField tfUrl;
     private JLabel lblValid;
 
@@ -45,5 +45,5 @@
         gc.weightx = 1.0;
         gc.fill = GridBagConstraints.HORIZONTAL;
-        pnl.add(tfUrl = new JTextField(), gc);
+        pnl.add(tfUrl = new JosmTextField(), gc);
         tfUrl.getDocument().addDocumentListener(new ChangetQueryUrlValidator());
         tfUrl.addFocusListener(
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 5886)
@@ -42,5 +42,4 @@
 import javax.swing.AbstractAction;
 import javax.swing.Action;
-import javax.swing.BorderFactory;
 import javax.swing.Box;
 import javax.swing.DefaultListCellRenderer;
@@ -50,5 +49,4 @@
 import javax.swing.JLabel;
 import javax.swing.JList;
-import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
@@ -79,5 +77,4 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Shortcut;
-import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.WindowGeometry;
 
@@ -504,30 +501,9 @@
                 }
             });
-            JMenuItem pasteK = new JMenuItem(
-                new AbstractAction(tr("Paste tag")){
-                public void actionPerformed(ActionEvent e) {
-                    String buf = Utils.getClipboardContent().trim();
-                    if (buf.isEmpty()) return;
-                    keys.setSelectedItem(buf);
-                }
-            });
-            JMenuItem pasteV = new JMenuItem(
-                new AbstractAction(tr("Paste value")){
-                public void actionPerformed(ActionEvent e) {
-                    String buf = Utils.getClipboardContent().trim();
-                    if (buf.isEmpty()) return;
-                    values.setSelectedItem(buf);
-                }
-            });
-            
             {
-                add(pasteK);
-                add(pasteV);
-                addSeparator();
                 add(fixTagLanguageCb);
                 fixTagLanguageCb.setState(PROPERTY_FIX_TAG_LOCALE.get());
             }
         };
-                
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 5886)
@@ -17,5 +17,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 import javax.swing.SwingUtilities;
 import javax.swing.event.ListSelectionEvent;
@@ -24,9 +23,9 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.coor.CoordinateFormat;
 import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.gui.BookmarkList;
 import org.openstreetmap.josm.gui.BookmarkList.Bookmark;
 import org.openstreetmap.josm.gui.JMultilineLabel;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -50,5 +49,5 @@
     /** displays information about the current download area */
     private JMultilineLabel lblCurrentDownloadArea;
-    final private JTextArea bboxDisplay = new JTextArea();
+    final private JosmTextArea bboxDisplay = new JosmTextArea();
     /** the add action */
     private AddAction actAdd;
Index: /trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java	(revision 5886)
@@ -23,6 +23,4 @@
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
 import javax.swing.UIManager;
 import javax.swing.border.Border;
@@ -34,4 +32,6 @@
 import org.openstreetmap.josm.data.coor.CoordinateFormat;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -49,7 +49,7 @@
 public class BoundingBoxSelection implements DownloadSelection {
 
-    private JTextField[] latlon = null;
-    private final JTextArea tfOsmUrl = new JTextArea();
-    private final JTextArea showUrl = new JTextArea();
+    private JosmTextField[] latlon = null;
+    private final JosmTextArea tfOsmUrl = new JosmTextArea();
+    private final JosmTextArea showUrl = new JosmTextArea();
     private DownloadDialog parent;
 
@@ -63,8 +63,8 @@
 
     protected void buildDownloadAreaInputFields() {
-        latlon = new JTextField[4];
+        latlon = new JosmTextField[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 JosmTextField(11);
+            latlon[i].setMinimumSize(new Dimension(100,new JosmTextField().getMinimumSize().height));
             latlon[i].addFocusListener(new SelectAllOnFocusHandler(latlon[i]));
         }
@@ -160,4 +160,8 @@
     }
 
+    /**
+     * Replies the download area.
+     * @return The download area
+     */
     public Bounds getDownloadArea() {
         double[] values = new double[4];
@@ -191,5 +195,5 @@
         latlon[2].setText(area.getMax().latToString(CoordinateFormat.DECIMAL_DEGREES));
         latlon[3].setText(area.getMax().lonToString(CoordinateFormat.DECIMAL_DEGREES));
-        for (JTextField tf: latlon) {
+        for (JosmTextField tf: latlon) {
             resetErrorMessage(tf);
         }
@@ -203,10 +207,10 @@
     private Border errorBorder = BorderFactory.createLineBorder(Color.RED, 1);
 
-    protected void setErrorMessage(JTextField tf, String msg) {
+    protected void setErrorMessage(JosmTextField tf, String msg) {
         tf.setBorder(errorBorder);
         tf.setToolTipText(msg);
     }
 
-    protected void resetErrorMessage(JTextField tf) {
+    protected void resetErrorMessage(JosmTextField tf) {
         tf.setBorder(UIManager.getBorder("TextField.border"));
         tf.setToolTipText("");
@@ -214,7 +218,7 @@
 
     class LatValueChecker extends FocusAdapter implements ActionListener{
-        private JTextField tfLatValue;
-
-        public LatValueChecker(JTextField tfLatValue) {
+        private JosmTextField tfLatValue;
+
+        public LatValueChecker(JosmTextField tfLatValue) {
             this.tfLatValue = tfLatValue;
         }
@@ -246,7 +250,7 @@
 
     class LonValueChecker extends FocusAdapter implements ActionListener {
-        private JTextField tfLonValue;
-
-        public LonValueChecker(JTextField tfLonValue) {
+        private JosmTextField tfLonValue;
+
+        public LonValueChecker(JosmTextField tfLonValue) {
             this.tfLonValue = tfLonValue;
         }
Index: /trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java	(revision 5886)
@@ -22,5 +22,4 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.border.EtchedBorder;
@@ -36,4 +35,5 @@
 import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -82,5 +82,5 @@
         cbId.setEditor(new BasicComboBoxEditor() {
             @Override
-            protected JTextField createEditorComponent() {
+            protected JosmTextField createEditorComponent() {
                 return tfId;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 5886)
@@ -24,5 +24,4 @@
 import javax.swing.JComponent;
 import javax.swing.JDialog;
-import javax.swing.JEditorPane;
 import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
@@ -40,8 +39,8 @@
 import javax.swing.text.Element;
 import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.html.HTML.Tag;
 import javax.swing.text.html.HTMLDocument;
 import javax.swing.text.html.HTMLEditorKit;
 import javax.swing.text.html.StyleSheet;
-import javax.swing.text.html.HTML.Tag;
 
 import org.openstreetmap.josm.Main;
@@ -49,4 +48,5 @@
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.MainMenu;
+import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.OpenBrowser;
@@ -106,5 +106,5 @@
 
     /** the help browser */
-    private JEditorPane help;
+    private JosmEditorPane help;
 
     /** the help browser history */
@@ -166,5 +166,5 @@
 
     protected void build() {
-        help = new JEditorPane();
+        help = new JosmEditorPane();
         HTMLEditorKit kit = new HTMLEditorKit();
         kit.setStyleSheet(buildStyleSheet());
Index: /trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java	(revision 5886)
@@ -26,5 +26,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JPasswordField;
 import javax.swing.JTextField;
 import javax.swing.KeyStroke;
@@ -150,5 +149,5 @@
     protected static class CredentialPanel extends JPanel {
         protected JTextField tfUserName;
-        protected JPasswordField tfPassword;
+        protected JosmPasswordField tfPassword;
         protected JCheckBox cbSaveCredentials;
         protected JMultilineLabel lblHeading;
Index: /trunk/src/org/openstreetmap/josm/gui/io/FilenameCellEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/FilenameCellEditor.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/io/FilenameCellEditor.java	(revision 5886)
@@ -18,5 +18,4 @@
 import javax.swing.JPanel;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.event.CellEditorListener;
 import javax.swing.event.ChangeEvent;
@@ -24,4 +23,5 @@
 
 import org.openstreetmap.josm.actions.SaveActionBase;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -32,5 +32,5 @@
  */
 class FilenameCellEditor extends JPanel implements TableCellEditor {
-    private JTextField tfFileName;
+    private JosmTextField tfFileName;
     private CopyOnWriteArrayList<CellEditorListener> listeners;
     private File value;
@@ -47,5 +47,5 @@
         gc.weightx = 1.0;
         gc.weighty = 1.0;
-        add(tfFileName = new JTextField(), gc);
+        add(tfFileName = new JosmTextField(), gc);
 
         gc.gridx = 1;
Index: /trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java	(revision 5886)
@@ -22,5 +22,4 @@
 import javax.swing.JPanel;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.event.CellEditorListener;
 import javax.swing.event.ChangeEvent;
@@ -30,5 +29,5 @@
 import org.openstreetmap.josm.actions.SaveActionBase;
 import org.openstreetmap.josm.tools.GBC;
-
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 class LayerNameAndFilePathTableCell extends JPanel implements TableCellRenderer, TableCellEditor {
@@ -39,5 +38,5 @@
     private final JLabel lblLayerName = new JLabel();
     private final JLabel lblFilename = new JLabel("");
-    private final JTextField tfFilename = new JTextField();
+    private final JosmTextField tfFilename = new JosmTextField();
     private final JButton btnFileChooser = new JButton(new LaunchFileChooserAction());
 
Index: /trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java	(revision 5886)
@@ -12,5 +12,4 @@
 
 import javax.swing.BorderFactory;
-import javax.swing.JEditorPane;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
@@ -22,4 +21,5 @@
 
 import org.openstreetmap.josm.data.osm.Changeset;
+import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -28,5 +28,5 @@
     private UploadStrategySpecification spec = new UploadStrategySpecification();
     private int numObjects;
-    private JEditorPane jepMessage;
+    private JosmEditorPane jepMessage;
     private JLabel lblWarning;
 
@@ -103,5 +103,5 @@
 
     protected void build() {
-        jepMessage = new JEditorPane("text/html", "");
+        jepMessage = new JosmEditorPane("text/html", "");
         jepMessage.setOpaque(false);
         jepMessage.setEditable(false);
@@ -142,4 +142,7 @@
     }
 
+    /**
+     * Constructs a new {@code UploadParameterSummaryPanel}.
+     */
     public UploadParameterSummaryPanel() {
         build();
Index: /trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java	(revision 5886)
@@ -25,5 +25,4 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
 import javax.swing.UIManager;
 import javax.swing.event.DocumentEvent;
@@ -34,4 +33,5 @@
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -56,5 +56,5 @@
     private Map<UploadStrategy, JLabel> lblNumRequests;
     private Map<UploadStrategy, JMultilineLabel> lblStrategies;
-    private JTextField tfChunkSize;
+    private JosmTextField tfChunkSize;
     private JPanel pnlMultiChangesetPolicyPanel;
     private JRadioButton rbFillOneChangeset;
@@ -136,5 +136,5 @@
         gc.weighty = 0.0;
         gc.gridwidth = 1;
-        pnl.add(tfChunkSize = new JTextField(4), gc);
+        pnl.add(tfChunkSize = new JosmTextField(4), gc);
         gc.gridx = 3;
         gc.gridy = 2;
@@ -383,6 +383,6 @@
         public void focusGained(FocusEvent e) {
             Component c = e.getComponent();
-            if (c instanceof JTextField) {
-                JTextField tf = (JTextField)c;
+            if (c instanceof JosmTextField) {
+                JosmTextField tf = (JosmTextField)c;
                 tf.selectAll();
             }
@@ -392,5 +392,5 @@
 
     class ChunkSizeInputVerifier implements DocumentListener, PropertyChangeListener {
-        protected void setErrorFeedback(JTextField tf, String message) {
+        protected void setErrorFeedback(JosmTextField tf, String message) {
             tf.setBorder(BorderFactory.createLineBorder(Color.RED, 1));
             tf.setToolTipText(message);
@@ -398,5 +398,5 @@
         }
 
-        protected void clearErrorFeedback(JTextField tf, String message) {
+        protected void clearErrorFeedback(JosmTextField tf, String message) {
             tf.setBorder(UIManager.getBorder("TextField.border"));
             tf.setToolTipText(message);
Index: /trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 5886)
@@ -38,5 +38,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 
 import org.openstreetmap.josm.Main;
@@ -79,4 +78,5 @@
 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.tools.DateUtils;
 import org.openstreetmap.josm.tools.FilteredCollection;
@@ -697,5 +697,5 @@
                 JPanel p = new JPanel(new GridBagLayout());
                 p.add(new JLabel(tr("Following problems found:")), GBC.eol());
-                JTextArea info = new JTextArea(result, 20, 60);
+                JosmTextArea info = new JosmTextArea(result, 20, 60);
                 info.setCaretPosition(0);
                 info.setEditable(false);
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 5886)
@@ -53,5 +53,4 @@
 import javax.swing.JSeparator;
 import javax.swing.JSlider;
-import javax.swing.JTextField;
 import javax.swing.ListSelectionModel;
 import javax.swing.SwingConstants;
@@ -81,4 +80,5 @@
 import org.openstreetmap.josm.tools.PrimaryDateParser;
 import org.xml.sax.SAXException;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /** This class displays the window to select the GPX file and the offset (timezone + delta).
@@ -119,6 +119,6 @@
     JPanel outerPanel;
     JosmComboBox cbGpx;
-    JTextField tfTimezone;
-    JTextField tfOffset;
+    JosmTextField tfTimezone;
+    JosmTextField tfOffset;
     JCheckBox cbExifImg;
     JCheckBox cbTaggedImg;
@@ -224,5 +224,5 @@
         JPanel panel;
         JLabel lbExifTime;
-        JTextField tfGpsTime;
+        JosmTextField tfGpsTime;
         JosmComboBox cbTimezones;
         ImageDisplay imgDisp;
@@ -269,5 +269,5 @@
             panelTf.add(new JLabel(tr("Gps time (read from the above photo): ")), gc);
 
-            tfGpsTime = new JTextField(12);
+            tfGpsTime = new JosmTextField(12);
             tfGpsTime.setEnabled(false);
             tfGpsTime.setMinimumSize(new Dimension(155, tfGpsTime.getMinimumSize().height));
@@ -495,5 +495,5 @@
         }
 
-        tfTimezone = new JTextField(10);
+        tfTimezone = new JosmTextField(10);
         tfTimezone.setText(formatTimezone(timezone));
 
@@ -505,5 +505,5 @@
         delta = delta / 1000;  // milliseconds -> seconds
 
-        tfOffset = new JTextField(10);
+        tfOffset = new JosmTextField(10);
         tfOffset.setText(Long.toString(delta));
 
Index: /trunk/src/org/openstreetmap/josm/gui/oauth/AccessTokenInfoPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/AccessTokenInfoPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/AccessTokenInfoPanel.java	(revision 5886)
@@ -11,8 +11,8 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.data.oauth.OAuthToken;
 import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -22,6 +22,6 @@
 public class AccessTokenInfoPanel extends JPanel {
 
-    private JTextField tfAccessTokenKey;
-    private JTextField tfAccessTokenSecret;
+    private JosmTextField tfAccessTokenKey;
+    private JosmTextField tfAccessTokenSecret;
     private JCheckBox cbSaveAccessTokenInPreferences;
 
@@ -39,5 +39,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfAccessTokenKey = new JTextField(), gc);
+        add(tfAccessTokenKey = new JosmTextField(), gc);
         tfAccessTokenKey.setEditable(false);
 
@@ -51,5 +51,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfAccessTokenSecret = new JTextField(), gc);
+        add(tfAccessTokenSecret = new JosmTextField(), gc);
         tfAccessTokenSecret.setEditable(false);
 
Index: /trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java	(revision 5886)
@@ -15,5 +15,4 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.data.Preferences;
@@ -26,4 +25,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -41,9 +41,9 @@
 
     private JCheckBox cbUseDefaults;
-    private JTextField tfConsumerKey;
-    private JTextField tfConsumerSecret;
-    private JTextField tfRequestTokenURL;
-    private JTextField tfAccessTokenURL;
-    private JTextField tfAuthoriseURL;
+    private JosmTextField tfConsumerKey;
+    private JosmTextField tfConsumerSecret;
+    private JosmTextField tfRequestTokenURL;
+    private JosmTextField tfAccessTokenURL;
+    private JosmTextField tfAuthoriseURL;
     private UseDefaultItemListener ilUseDefault;
     private String apiUrl;
@@ -70,5 +70,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfConsumerKey = new JTextField(), gc);
+        add(tfConsumerKey = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfConsumerKey);
 
@@ -81,5 +81,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfConsumerSecret = new JTextField(), gc);
+        add(tfConsumerSecret = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfConsumerSecret);
 
@@ -92,5 +92,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfRequestTokenURL = new JTextField(), gc);
+        add(tfRequestTokenURL = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfRequestTokenURL);
 
@@ -103,5 +103,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfAccessTokenURL = new JTextField(), gc);
+        add(tfAccessTokenURL = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenURL);
 
@@ -115,5 +115,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfAuthoriseURL = new JTextField(), gc);
+        add(tfAuthoriseURL = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfAuthoriseURL);
 
@@ -177,5 +177,5 @@
     protected void setChildComponentsEnabled(boolean enabled){
         for (Component c: getComponents()) {
-            if (c instanceof JTextField || c instanceof JLabel) {
+            if (c instanceof JosmTextField || c instanceof JLabel) {
                 c.setEnabled(enabled);
             }
Index: /trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java	(revision 5886)
@@ -13,6 +13,6 @@
 import java.awt.event.ActionEvent;
 import java.io.IOException;
+import java.net.Authenticator.RequestorType;
 import java.net.PasswordAuthentication;
-import java.net.Authenticator.RequestorType;
 
 import javax.swing.AbstractAction;
@@ -21,7 +21,5 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JPasswordField;
 import javax.swing.JTabbedPane;
-import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -41,4 +39,5 @@
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
@@ -59,6 +58,6 @@
 public class FullyAutomaticAuthorizationUI extends AbstractAuthorizationUI {
 
-    private JTextField tfUserName;
-    private JPasswordField tfPassword;
+    private JosmTextField tfUserName;
+    private JosmPasswordField tfPassword;
     private UserNameValidator valUserName;
     private PasswordValidator valPassword;
@@ -116,5 +115,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfUserName = new JTextField(), gc);
+        pnl.add(tfUserName = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfUserName);
         valUserName = new UserNameValidator(tfUserName);
Index: /trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java	(revision 5886)
@@ -12,16 +12,15 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JPasswordField;
-import javax.swing.JTextField;
 import javax.swing.text.JTextComponent;
 
 import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator;
 import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 
 public class FullyAutomaticPropertiesPanel extends JPanel {
 
-    private JTextField tfUserName;
-    private JPasswordField tfPassword;
+    private JosmTextField tfUserName;
+    private JosmPasswordField tfPassword;
     private UserNameValidator valUserName;
 
@@ -43,5 +42,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfUserName = new JTextField(), gc);
+        pnl.add(tfUserName = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfUserName);
         valUserName = new UserNameValidator(tfUserName);
Index: /trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java	(revision 5886)
@@ -19,5 +19,4 @@
 import javax.swing.JPanel;
 import javax.swing.JTabbedPane;
-import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -32,4 +31,5 @@
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -41,7 +41,7 @@
 public class ManualAuthorizationUI extends AbstractAuthorizationUI{
 
-    private JTextField tfAccessTokenKey;
+    private JosmTextField tfAccessTokenKey;
     private AccessTokenKeyValidator valAccessTokenKey;
-    private JTextField tfAccessTokenSecret;
+    private JosmTextField tfAccessTokenSecret;
     private AccessTokenSecretValidator valAccessTokenSecret;
     private JCheckBox cbSaveToPreferences;
@@ -76,5 +76,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfAccessTokenKey = new JTextField(), gc);
+        pnl.add(tfAccessTokenKey = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenKey);
         valAccessTokenKey = new AccessTokenKeyValidator(tfAccessTokenKey);
@@ -90,5 +90,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfAccessTokenSecret = new JTextField(), gc);
+        pnl.add(tfAccessTokenSecret = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenSecret);
         valAccessTokenSecret = new AccessTokenSecretValidator(tfAccessTokenSecret);
Index: /trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java	(revision 5886)
@@ -20,5 +20,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 import javax.swing.SwingUtilities;
 
@@ -31,4 +30,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.OpenBrowser;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -207,5 +207,5 @@
     private class RetrieveAccessTokenPanel extends JPanel {
 
-        private JTextField tfAuthoriseUrl;
+        private JosmTextField tfAuthoriseUrl;
 
         protected JPanel buildTitlePanel() {
@@ -246,5 +246,5 @@
             gc.gridx = 1;
             gc.weightx = 1.0;
-            pnl.add(tfAuthoriseUrl = new JTextField(), gc);
+            pnl.add(tfAuthoriseUrl = new JosmTextField(), gc);
             tfAuthoriseUrl.setEditable(false);
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java	(revision 5886)
@@ -10,8 +10,8 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /*
@@ -50,8 +50,8 @@
     private JCheckBox audioMarkersFromStart = new JCheckBox(tr("Start of track (will always do this if no other markers available)."));
 
-    private JTextField audioLeadIn = new JTextField(8);
-    private JTextField audioForwardBackAmount = new JTextField(8);
-    private JTextField audioFastForwardMultiplier = new JTextField(8);
-    private JTextField audioCalibration = new JTextField(8);
+    private JosmTextField audioLeadIn = new JosmTextField(8);
+    private JosmTextField audioForwardBackAmount = new JosmTextField(8);
+    private JosmTextField audioFastForwardMultiplier = new JosmTextField(8);
+    private JosmTextField audioCalibration = new JosmTextField(8);
 
     public void addGui(PreferenceTabbedPane gui) {
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 5886)
@@ -30,5 +30,4 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
-import javax.swing.JTextField;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
@@ -53,4 +52,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class PluginPreference extends DefaultTabPreferenceSetting {
@@ -98,5 +98,5 @@
     }
 
-    private JTextField tfFilter;
+    private JosmTextField tfFilter;
     private PluginListPanel pnlPluginPreferences;
     private PluginPreferencesModel model;
@@ -123,5 +123,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfFilter = new JTextField(), gc);
+        pnl.add(tfFilter = new JosmTextField(), gc);
         tfFilter.setToolTipText(tr("Enter a search expression"));
         SelectAllOnFocusGainedDecorator.decorate(tfFilter);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 5886)
@@ -59,5 +59,4 @@
 import javax.swing.JSeparator;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.JToolBar;
 import javax.swing.KeyStroke;
@@ -74,5 +73,4 @@
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableCellRenderer;
 
 import org.openstreetmap.josm.Main;
@@ -85,4 +83,5 @@
 import org.openstreetmap.josm.gui.util.TableHelper;
 import org.openstreetmap.josm.gui.widgets.JFileChooserManager;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.io.MirroredInputStream;
 import org.openstreetmap.josm.io.OsmTransferException;
@@ -680,6 +679,6 @@
     protected class EditSourceEntryDialog extends ExtendedDialog {
 
-        private JTextField tfTitle;
-        private JTextField tfURL;
+        private JosmTextField tfTitle;
+        private JosmTextField tfURL;
         private JCheckBox cbActive;
 
@@ -691,9 +690,9 @@
             JPanel p = new JPanel(new GridBagLayout());
 
-            tfTitle = new JTextField(60);
+            tfTitle = new JosmTextField(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 JosmTextField(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));
@@ -1318,5 +1317,5 @@
 
     class FileOrUrlCellEditor extends JPanel implements TableCellEditor {
-        private JTextField tfFileName;
+        private JosmTextField tfFileName;
         private CopyOnWriteArrayList<CellEditorListener> listeners;
         private String value;
@@ -1334,5 +1333,5 @@
             gc.weightx = 1.0;
             gc.weighty = 1.0;
-            add(tfFileName = new JTextField(), gc);
+            add(tfFileName = new JosmTextField(), gc);
 
             gc.gridx = 1;
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 5886)
@@ -34,5 +34,4 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -56,4 +55,5 @@
 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.GBC;
@@ -144,10 +144,10 @@
     protected List<PrefEntry> data;
     protected List<PrefEntry> displayData;
-    protected JTextField txtFilter;
+    protected JosmTextField txtFilter;
 
     public void addGui(final PreferenceTabbedPane gui) {
         JPanel p = gui.createPreferenceTab(this);
 
-        txtFilter = new JTextField();
+        txtFilter = new JosmTextField();
         JLabel lbFilter = new JLabel(tr("Search: "));
         lbFilter.setLabelFor(txtFilter);
@@ -453,5 +453,5 @@
     private static class SettingCellEditor extends DefaultCellEditor {
         public SettingCellEditor() {
-            super(new JTextField());
+            super(new JosmTextField());
         }
 
@@ -523,5 +523,5 @@
         JPanel p = new JPanel(new GridBagLayout());
         p.add(new JLabel(tr("Key")), GBC.std().insets(0,0,5,0));
-        JTextField tkey = new JTextField("", 50);
+        JosmTextField tkey = new JosmTextField("", 50);
         p.add(tkey, GBC.eop().insets(5,0,0,0).fill(GBC.HORIZONTAL));
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java	(revision 5886)
@@ -14,5 +14,4 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.table.AbstractTableModel;
 
@@ -21,4 +20,5 @@
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
 import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.WindowGeometry;
@@ -55,5 +55,5 @@
         table.setTableHeader(null);
 
-        DefaultCellEditor editor = new DefaultCellEditor(new JTextField());
+        DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField());
         editor.setClickCountToStart(1);
         table.setDefaultEditor(table.getColumnClass(0), editor);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java	(revision 5886)
@@ -19,10 +19,9 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.JToolBar;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
+import javax.swing.table.AbstractTableModel;
 import javax.swing.table.TableCellEditor;
-import javax.swing.table.AbstractTableModel;
 
 import org.openstreetmap.josm.data.Preferences.ListListSetting;
@@ -30,4 +29,5 @@
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
 import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -95,5 +95,5 @@
         table.setTableHeader(null);
 
-        DefaultCellEditor editor = new DefaultCellEditor(new JTextField());
+        DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField());
         editor.setClickCountToStart(1);
         table.setDefaultEditor(table.getColumnClass(0), editor);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java	(revision 5886)
@@ -23,10 +23,9 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.JToolBar;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
+import javax.swing.table.AbstractTableModel;
 import javax.swing.table.TableCellEditor;
-import javax.swing.table.AbstractTableModel;
 
 import org.openstreetmap.josm.data.Preferences.MapListSetting;
@@ -34,4 +33,5 @@
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
 import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -117,5 +117,5 @@
         table.getTableHeader().getColumnModel().getColumn(0).setHeaderValue(tr("Key"));
         table.getTableHeader().getColumnModel().getColumn(1).setHeaderValue(tr("Value"));
-        DefaultCellEditor editor = new DefaultCellEditor(new JTextField());
+        DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField());
         editor.setClickCountToStart(1);
         table.setDefaultEditor(table.getColumnClass(0), editor);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java	(revision 5886)
@@ -8,5 +8,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.data.Preferences.StringSetting;
@@ -14,4 +13,5 @@
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
 import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 
@@ -19,5 +19,5 @@
 
     PrefEntry entry;
-    JTextField tvalue;
+    JosmTextField tvalue;
 
     public StringEditor(final PreferenceTabbedPane gui, PrefEntry entry, StringSetting setting) {
@@ -37,5 +37,5 @@
 
         p.add(new JLabel(tr("Value: ")), GBC.std());
-        tvalue = new JTextField(orig, 50);
+        tvalue = new JosmTextField(orig, 50);
         p.add(tvalue, GBC.eop().insets(5,0,0,0).fill(GBC.HORIZONTAL));
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 5886)
@@ -17,5 +17,4 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
@@ -30,4 +29,5 @@
 import org.openstreetmap.josm.tools.template_engine.ParseError;
 import org.openstreetmap.josm.tools.template_engine.TemplateParser;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class GPXSettingsPanel extends JPanel implements ValidationListener {
@@ -45,7 +45,7 @@
     private JRadioButton drawRawGpsLinesNone = new JRadioButton(tr("None"));
     private ActionListener drawRawGpsLinesActionListener;
-    private JTextField drawRawGpsMaxLineLength = new JTextField(8);
-    private JTextField drawRawGpsMaxLineLengthLocal = new JTextField(8);
-    private JTextField drawLineWidth = new JTextField(2);
+    private JosmTextField drawRawGpsMaxLineLength = new JosmTextField(8);
+    private JosmTextField drawRawGpsMaxLineLengthLocal = new JosmTextField(8);
+    private JosmTextField drawLineWidth = new JosmTextField(2);
     private JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported"));
     private JCheckBox largeGpsPoints = new JCheckBox(tr("Draw large GPS points"));
@@ -62,10 +62,10 @@
     private JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows"));
     private JCheckBox drawGpsArrowsFast = new JCheckBox(tr("Fast drawing (looks uglier)"));
-    private JTextField drawGpsArrowsMinDist = new JTextField(8);
+    private JosmTextField drawGpsArrowsMinDist = new JosmTextField(8);
     private JCheckBox colorDynamic = new JCheckBox(tr("Dynamic color range based on data limits"));
     private JosmComboBox waypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
-    private JTextField waypointLabelPattern = new JTextField();
+    private JosmTextField waypointLabelPattern = new JosmTextField();
     private JosmComboBox audioWaypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
-    private JTextField audioWaypointLabelPattern = new JTextField();
+    private JosmTextField audioWaypointLabelPattern = new JosmTextField();
     private JCheckBox useGpsAntialiasing = new JCheckBox(tr("Smooth GPX graphics (antialiasing)"));
 
@@ -422,5 +422,5 @@
     }
 
-    private void updateWaypointLabelCombobox(JosmComboBox cb, JTextField tf, TemplateEntryProperty property) {
+    private void updateWaypointLabelCombobox(JosmComboBox cb, JosmTextField tf, TemplateEntryProperty property) {
         String labelPattern = property.getAsString();
         boolean found = false;
@@ -439,5 +439,5 @@
     }
 
-    private void updateWaypointPattern(JosmComboBox cb, JTextField tf) {
+    private void updateWaypointPattern(JosmComboBox cb, JosmTextField tf) {
         if (cb.getSelectedIndex() == WAYPOINT_LABEL_CUSTOM) {
             tf.setEnabled(true);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java	(revision 5886)
@@ -9,6 +9,4 @@
 import javax.swing.AbstractButton;
 import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
@@ -18,4 +16,6 @@
 
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -27,6 +27,6 @@
 public abstract class AddImageryPanel extends JPanel {
 
-    protected final JTextArea rawUrl = new JTextArea(3, 40);
-    protected final JTextField name = new JTextField();
+    protected final JosmTextArea rawUrl = new JosmTextArea(3, 40);
+    protected final JosmTextField name = new JosmTextField();
     
     protected final Collection<ContentValidationListener> listeners = new ArrayList<ContentValidationListener>();
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanel.java	(revision 5886)
@@ -10,9 +10,9 @@
 
 import javax.swing.JLabel;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
 import javax.swing.text.View;
 
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Utils;
@@ -20,6 +20,6 @@
 public class AddTMSLayerPanel extends AddImageryPanel {
 
-    private final JTextField tmsZoom = new JTextField();
-    private final JTextArea tmsUrl = new JTextArea(3, 40);
+    private final JosmTextField tmsZoom = new JosmTextField();
+    private final JosmTextArea tmsUrl = new JosmTextArea(3, 40);
     private final KeyAdapter keyAdapter = new KeyAdapter() {
         @Override
@@ -29,4 +29,7 @@
     };
 
+    /**
+     * Constructs a new {@code AddTMSLayerPanel}.
+     */
     public AddTMSLayerPanel() {
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 5886)
@@ -18,8 +18,8 @@
 import javax.swing.JOptionPane;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.io.imagery.WMSImagery;
 import org.openstreetmap.josm.tools.GBC;
@@ -32,7 +32,10 @@
     private final WMSLayerTree tree = new WMSLayerTree();
     private final JLabel wmsInstruction;
-    private final JTextArea wmsUrl = new JTextArea(3, 40);
+    private final JosmTextArea wmsUrl = new JosmTextArea(3, 40);
     private final JButton showBounds = new JButton(tr("Show bounds"));
 
+    /**
+     * Constructs a new {@code AddWMSLayerPanel}.
+     */
     public AddWMSLayerPanel() {
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 5886)
@@ -29,5 +29,4 @@
 import javax.swing.Box;
 import javax.swing.JButton;
-import javax.swing.JEditorPane;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
@@ -62,4 +61,5 @@
 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
+import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -663,12 +663,12 @@
             try {
                 url = new URL(eulaUrl.replaceAll("\\{lang\\}", LanguageInfo.getWikiLanguagePrefix()));
-                JEditorPane htmlPane = null;
+                JosmEditorPane htmlPane = null;
                 try {
-                    htmlPane = new JEditorPane(url);
+                    htmlPane = new JosmEditorPane(url);
                 } catch (IOException e1) {
                     // give a second chance with a default Locale 'en'
                     try {
                         url = new URL(eulaUrl.replaceAll("\\{lang\\}", ""));
-                        htmlPane = new JEditorPane(url);
+                        htmlPane = new JosmEditorPane(url);
                     } catch (IOException e2) {
                         JOptionPane.showMessageDialog(gui ,tr("EULA license URL not available: {0}", eulaUrl));
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java	(revision 5886)
@@ -10,9 +10,9 @@
 import javax.swing.JPanel;
 import javax.swing.JSpinner;
-import javax.swing.JTextField;
 import javax.swing.SpinnerNumberModel;
 
 import org.openstreetmap.josm.gui.layer.TMSLayer;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -28,5 +28,5 @@
     private final JSpinner maxZoomLvl;
     private final JCheckBox addToSlippyMapChosser = new JCheckBox();
-    private final JTextField tilecacheDir = new JTextField();
+    private final JosmTextField tilecacheDir = new JosmTextField();
 
     /**
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java	(revision 5886)
@@ -15,5 +15,4 @@
 import javax.swing.JScrollPane;
 import javax.swing.JSeparator;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.data.AutosaveTask;
@@ -26,4 +25,5 @@
 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class BackupPreference implements SubPreferenceSetting {
@@ -38,6 +38,6 @@
     private JCheckBox keepBackup;
     private JCheckBox autosave;
-    private final JTextField autosaveInterval = new JTextField(8);
-    private final JTextField backupPerLayer = new JTextField(8);
+    private final JosmTextField autosaveInterval = new JosmTextField(8);
+    private final JosmTextField backupPerLayer = new JosmTextField(8);
 
     @Override
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java	(revision 5886)
@@ -15,5 +15,4 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
@@ -23,4 +22,5 @@
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.plugins.PluginHandler;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -59,5 +59,5 @@
     private Map<Policy, JRadioButton> rbVersionBasedUpatePolicy;
     private Map<Policy, JRadioButton> rbTimeBasedUpatePolicy;
-    private JTextField tfUpdateInterval;
+    private JosmTextField tfUpdateInterval;
     private JLabel lblUpdateInterval;
 
@@ -96,5 +96,5 @@
         JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
         pnl.add(lblUpdateInterval = new JLabel(tr("Update interval (in days):")));
-        pnl.add(tfUpdateInterval = new JTextField(5));
+        pnl.add(tfUpdateInterval = new JosmTextField(5));
         SelectAllOnFocusGainedDecorator.decorate(tfUpdateInterval);
         return pnl;
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 5886)
@@ -19,5 +19,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -28,4 +27,5 @@
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -42,5 +42,5 @@
     private class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener {
 
-        public JTextField filter;
+        public JosmTextField filter;
         private ProjectionCodeListModel model;
         public JList selectionList;
@@ -108,5 +108,5 @@
 
         private void build() {
-            filter = new JTextField(30);
+            filter = new JosmTextField(30);
             filter.setColumns(10);
             filter.getDocument().addDocumentListener(this);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 5886)
@@ -21,5 +21,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 import javax.swing.plaf.basic.BasicComboBoxEditor;
 
@@ -37,4 +36,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class CustomProjectionChoice extends AbstractProjectionChoice implements SubPrefsOptions {
@@ -48,5 +48,5 @@
     private static class PreferencePanel extends JPanel {
 
-        public JTextField input;
+        public JosmTextField input;
         private HistoryComboBox cbInput;
 
@@ -56,10 +56,10 @@
 
         private void build(String initialText, final ActionListener listener) {
-            input = new JTextField(30);
+            input = new JosmTextField(30);
             cbInput = new HistoryComboBox();
             cbInput.setPrototypeDisplayValue(new AutoCompletionListItem("xxxx"));
             cbInput.setEditor(new BasicComboBoxEditor() {
                 @Override
-                protected JTextField createEditorComponent() {
+                protected JosmTextField createEditorComponent() {
                     return input;
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 5886)
@@ -8,19 +8,18 @@
 import java.awt.GridBagLayout;
 import java.awt.Insets;
+import java.net.Authenticator.RequestorType;
 import java.net.PasswordAuthentication;
-import java.net.Authenticator.RequestorType;
 
 import javax.swing.BorderFactory;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JPasswordField;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
+import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.auth.CredentialsAgent;
 import org.openstreetmap.josm.io.auth.CredentialsAgentException;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
-import org.openstreetmap.josm.io.OsmApi;
 
 /**
@@ -32,8 +31,8 @@
 
     /** the OSM user name */
-    private JTextField tfOsmUserName;
+    private JosmTextField tfOsmUserName;
     private UserNameValidator valUserName;
     /** the OSM password */
-    private JPasswordField tfOsmPassword;
+    private JosmPasswordField tfOsmPassword;
     /** a panel with further information, e.g. some warnings */
     private JPanel decorationPanel;
@@ -56,5 +55,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfOsmUserName = new JTextField(), gc);
+        add(tfOsmUserName = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfOsmUserName);
         valUserName = new UserNameValidator(tfOsmUserName);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java	(revision 5886)
@@ -22,5 +22,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
@@ -34,4 +33,5 @@
 import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -214,6 +214,6 @@
      */
     private class AlreadyAuthorisedPanel extends JPanel {
-        private JTextField tfAccessTokenKey;
-        private JTextField tfAccessTokenSecret;
+        private JosmTextField tfAccessTokenKey;
+        private JosmTextField tfAccessTokenSecret;
 
         protected void build() {
@@ -238,5 +238,5 @@
             gc.gridx = 1;
             gc.weightx = 1.0;
-            add(tfAccessTokenKey = new JTextField(), gc);
+            add(tfAccessTokenKey = new JosmTextField(), gc);
             tfAccessTokenKey.setEditable(false);
 
@@ -250,5 +250,5 @@
             gc.gridx = 1;
             gc.weightx = 1.0;
-            add(tfAccessTokenSecret = new JTextField(), gc);
+            add(tfAccessTokenSecret = new JosmTextField(), gc);
             tfAccessTokenSecret.setEditable(false);
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 5886)
@@ -21,5 +21,4 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 import javax.swing.SwingUtilities;
 import javax.swing.event.DocumentEvent;
@@ -34,4 +33,5 @@
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 public class OsmApiUrlInputPanel extends JPanel {
@@ -40,5 +40,5 @@
     private JLabel lblValid;
     private JLabel lblApiUrl;
-    private JTextField tfOsmServerUrl;
+    private JosmTextField tfOsmServerUrl;
     private ApiUrlValidator valOsmServerUrl;
     private SideButton btnTest;
@@ -90,5 +90,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        add(tfOsmServerUrl = new JTextField(), gc);
+        add(tfOsmServerUrl = new JosmTextField(), gc);
         SelectAllOnFocusGainedDecorator.decorate(tfOsmServerUrl);
         valOsmServerUrl = new ApiUrlValidator(tfOsmServerUrl);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java	(revision 5886)
@@ -12,7 +12,7 @@
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
+import java.net.Authenticator.RequestorType;
 import java.net.PasswordAuthentication;
 import java.net.ProxySelector;
-import java.net.Authenticator.RequestorType;
 import java.util.HashMap;
 import java.util.Map;
@@ -22,7 +22,5 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JPasswordField;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
@@ -30,4 +28,5 @@
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
 import org.openstreetmap.josm.io.DefaultProxySelector;
@@ -75,10 +74,10 @@
     private ButtonGroup bgProxyPolicy;
     private Map<ProxyPolicy, JRadioButton> rbProxyPolicy;
-    private JTextField tfProxyHttpHost;
-    private JTextField tfProxyHttpPort;
-    private JTextField tfProxySocksHost;
-    private JTextField tfProxySocksPort;
-    private JTextField tfProxyHttpUser;
-    private JPasswordField tfProxyHttpPassword;
+    private JosmTextField tfProxyHttpHost;
+    private JosmTextField tfProxyHttpPort;
+    private JosmTextField tfProxySocksHost;
+    private JosmTextField tfProxySocksPort;
+    private JosmTextField tfProxyHttpUser;
+    private JosmPasswordField tfProxyHttpPassword;
 
     private JPanel pnlHttpProxyConfigurationPanel;
@@ -107,5 +106,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxyHttpHost = new JTextField(),gc);
+        pnl.add(tfProxyHttpHost = new JosmTextField(),gc);
 
         gc.gridy = 1;
@@ -117,5 +116,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxyHttpPort = new JTextField(5),gc);
+        pnl.add(tfProxyHttpPort = new JosmTextField(5),gc);
         tfProxyHttpPort.setMinimumSize(tfProxyHttpPort.getPreferredSize());
 
@@ -137,5 +136,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxyHttpUser = new JTextField(20),gc);
+        pnl.add(tfProxyHttpUser = new JosmTextField(20),gc);
         tfProxyHttpUser.setMinimumSize(tfProxyHttpUser.getPreferredSize());
 
@@ -182,5 +181,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxySocksHost = new JTextField(20),gc);
+        pnl.add(tfProxySocksHost = new JosmTextField(20),gc);
 
         gc.gridy = 1;
@@ -192,5 +191,5 @@
         gc.gridx = 1;
         gc.weightx = 1.0;
-        pnl.add(tfProxySocksPort = new JTextField(5), gc);
+        pnl.add(tfProxySocksPort = new JosmTextField(5), gc);
         tfProxySocksPort.setMinimumSize(tfProxySocksPort.getPreferredSize());
 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 5886)
@@ -29,5 +29,4 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
@@ -48,4 +47,5 @@
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -138,5 +138,5 @@
     JTable shortcutTable = new JTable();
 
-    private JTextField filterField = new JTextField();
+    private JosmTextField filterField = new JosmTextField();
 
     /** Creates new form prefJPanel */
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 5886)
@@ -46,5 +46,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
 import javax.swing.JToggleButton;
 import javax.swing.ListCellRenderer;
@@ -92,4 +91,6 @@
 import org.openstreetmap.josm.tools.template_engine.TemplateParser;
 import org.xml.sax.SAXException;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
+
 
 /**
@@ -522,6 +523,6 @@
             if (comp instanceof JosmComboBox) {
                 return ((JosmComboBox) comp).getEditor().getItem().toString();
-            } else if (comp instanceof JTextField) {
-                return ((JTextField) comp).getText();
+            } else if (comp instanceof JosmTextField) {
+                return ((JosmTextField) comp).getText();
             } else if (comp instanceof JPanel) {
                 return getValue(((JPanel)comp).getComponent(0));
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java	(revision 5886)
@@ -31,5 +31,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -50,4 +49,6 @@
 import org.openstreetmap.josm.gui.tagging.TaggingPreset.Role;
 import org.openstreetmap.josm.gui.tagging.TaggingPreset.Roles;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
+
 
 public class TaggingPresetSearchDialog extends ExtendedDialog implements SelectionChangedListener {
@@ -192,5 +193,5 @@
     }
 
-    private JTextField edSearchText;
+    private JosmTextField edSearchText;
     private JList lsResult;
     private JCheckBox ckOnlyApplicable;
@@ -239,5 +240,5 @@
         content.setLayout(new BorderLayout());
 
-        edSearchText = new JTextField();
+        edSearchText = new JosmTextField();
         edSearchText.getDocument().addDocumentListener(new DocumentListener() {
 
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java	(revision 5886)
@@ -11,5 +11,4 @@
 import javax.swing.ComboBoxEditor;
 import javax.swing.JTable;
-import javax.swing.JTextField;
 import javax.swing.event.CellEditorListener;
 import javax.swing.table.TableCellEditor;
@@ -22,4 +21,6 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.util.TableCellEditorSupport;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
+
 
 /**
@@ -32,5 +33,5 @@
  *
  */
-public class AutoCompletingTextField extends JTextField implements ComboBoxEditor, TableCellEditor {
+public class AutoCompletingTextField extends JosmTextField implements ComboBoxEditor, TableCellEditor {
 
     private Integer maxChars;
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java	(revision 5886)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.widgets;
 
-import javax.swing.JTextField;
 import javax.swing.text.JTextComponent;
 
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -13,5 +13,5 @@
  * @since 5765
  */
-public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends JTextField {
+public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends JosmTextField {
 
     protected final T validator;
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java	(revision 5886)
@@ -11,5 +11,4 @@
 
 import javax.swing.BorderFactory;
-import javax.swing.JTextField;
 import javax.swing.UIManager;
 import javax.swing.border.Border;
@@ -20,4 +19,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -110,6 +110,6 @@
         }
         if (addActionListener) {
-            if (tc instanceof JTextField) {
-                JTextField tf = (JTextField)tc;
+            if (tc instanceof JosmTextField) {
+                JosmTextField tf = (JosmTextField)tc;
                 tf.addActionListener(this);
             }
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java	(revision 5886)
@@ -19,5 +19,4 @@
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
-import javax.swing.JTextField;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -32,4 +31,5 @@
 import org.openstreetmap.josm.tools.OsmUrlToBounds;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -39,12 +39,12 @@
 public class BoundingBoxSelectionPanel extends JPanel {
 
-    private JTextField[] tfLatLon = null;
-    private final JTextField tfOsmUrl = new JTextField();
+    private JosmTextField[] tfLatLon = null;
+    private final JosmTextField tfOsmUrl = new JosmTextField();
 
     protected void buildInputFields() {
-        tfLatLon = new JTextField[4];
+        tfLatLon = new JosmTextField[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 JosmTextField(11);
+            tfLatLon[i].setMinimumSize(new Dimension(100,new JosmTextField().getMinimumSize().height));
             SelectAllOnFocusGainedDecorator.decorate(tfLatLon[i]);
         }
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java	(revision 5886)
@@ -12,5 +12,4 @@
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
-import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.text.Document;
@@ -20,4 +19,5 @@
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -27,5 +27,5 @@
  * @since 5696
  */
-public class DisableShortcutsOnFocusGainedTextField extends JTextField implements FocusListener {
+public class DisableShortcutsOnFocusGainedTextField extends JosmTextField implements FocusListener {
 
     /**
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java	(revision 5886)
@@ -22,9 +22,9 @@
  */
 public class HtmlPanel extends JPanel {
-    private JEditorPane jepMessage;
+    private JosmEditorPane jepMessage;
 
     protected void build() {
         setLayout(new BorderLayout());
-        jepMessage = new JEditorPane("text/html", "");
+        jepMessage = new JosmEditorPane("text/html", "");
         jepMessage.setOpaque(false);
         jepMessage.setEditable(false);
@@ -57,8 +57,15 @@
     }
 
+    /**
+     * Constructs a new {@code HtmlPanel}.
+     */
     public HtmlPanel() {
         build();
     }
 
+    /**
+     * Constructs a new {@code HtmlPanel} with the given HTML text.
+     * @param text the text to display
+     */
     public HtmlPanel(String text) {
         this();
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java	(revision 5886)
@@ -5,4 +5,8 @@
 import java.awt.Dimension;
 import java.awt.Toolkit;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -16,4 +20,5 @@
 import javax.swing.JList;
 import javax.swing.plaf.basic.ComboPopup;
+import javax.swing.text.JTextComponent;
 
 /**
@@ -185,4 +190,61 @@
             setMaximumRowCount(Math.max(getMaximumRowCount(), maxsize));
         }
+        // Handle text contextual menus for editable comboboxes
+        ContextMenuHandler handler = new ContextMenuHandler();
+        addPropertyChangeListener("editable", handler);
+        addPropertyChangeListener("editor", handler);
+    }
+    
+    protected class ContextMenuHandler extends MouseAdapter implements PropertyChangeListener {
+
+        private JTextComponent component;
+        private PopupMenuLauncher launcher;
+        
+        @Override public void propertyChange(PropertyChangeEvent evt) {
+            if (evt.getPropertyName().equals("editable")) {
+                if (evt.getNewValue().equals(true)) {
+                    enableMenu();
+                } else {
+                    disableMenu();
+                }
+            } else if (evt.getPropertyName().equals("editor")) {
+                disableMenu();
+                if (isEditable()) {
+                    enableMenu();
+                }
+            }
+        }
+        
+        private void enableMenu() {
+            if (launcher == null) {
+                Component editorComponent = getEditor().getEditorComponent();
+                if (editorComponent instanceof JTextComponent) {
+                    component = (JTextComponent) editorComponent;
+                    component.addMouseListener(this);
+                    launcher = TextContextualPopupMenu.enableMenuFor(component);
+                }
+            }
+        }
+
+        private void disableMenu() {
+            if (launcher != null) {
+                TextContextualPopupMenu.disableMenuFor(component, launcher);
+                launcher = null;
+                component.removeMouseListener(this);
+                component = null;
+            }
+        }
+        
+        @Override public void mousePressed(MouseEvent e) { processEvent(e); }
+        @Override public void mouseClicked(MouseEvent e) { processEvent(e); }
+        @Override public void mouseReleased(MouseEvent e) { processEvent(e); }
+        
+        private void processEvent(MouseEvent e) {
+            if (launcher != null && !e.isPopupTrigger()) {
+                if (launcher.getMenu().isShowing()) {
+                    launcher.getMenu().setVisible(false);
+                }
+            }
+        }
     }
     
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java	(revision 5886)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java	(revision 5886)
@@ -0,0 +1,61 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.widgets;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.swing.JEditorPane;
+
+/**
+ * Subclass of {@link JEditorPane} that adds a "native" context menu (cut/copy/paste/select all).
+ * @since 5885
+ */
+public class JosmEditorPane extends JEditorPane {
+
+    /**
+     * Creates a new <code>JosmEditorPane</code>.
+     * The document model is set to <code>null</code>.
+     */
+    public JosmEditorPane() {
+        TextContextualPopupMenu.enableMenuFor(this);
+    }
+
+    /**
+     * Creates a <code>JosmEditorPane</code> based on a specified URL for input.
+     *
+     * @param initialPage the URL
+     * @exception IOException if the URL is <code>null</code> or cannot be accessed
+     */
+    public JosmEditorPane(URL initialPage) throws IOException {
+        this();
+        setPage(initialPage);
+    }
+
+    /**
+     * Creates a <code>JosmEditorPane</code> based on a string containing
+     * a URL specification.
+     *
+     * @param url the URL
+     * @exception IOException if the URL is <code>null</code> or cannot be accessed
+     */
+    public JosmEditorPane(String url) throws IOException {
+        this();
+        setPage(url);
+    }
+
+    /**
+     * Creates a <code>JosmEditorPane</code> that has been initialized
+     * to the given text.  This is a convenience constructor that calls the
+     * <code>setContentType</code> and <code>setText</code> methods.
+     *
+     * @param type mime type of the given text
+     * @param text the text to initialize with; may be <code>null</code>
+     * @exception NullPointerException if the <code>type</code> parameter
+     *      is <code>null</code>
+     */
+    public JosmEditorPane(String type, String text) {
+        this();
+        setContentType(type);
+        setText(text);
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java	(revision 5886)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java	(revision 5886)
@@ -0,0 +1,85 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.widgets;
+
+import javax.swing.JTextArea;
+import javax.swing.text.Document;
+
+/**
+ * Subclass of {@link JTextArea} that adds a "native" context menu (cut/copy/paste/select all).
+ * @since 5885
+ */
+public class JosmTextArea extends JTextArea {
+
+    /**
+     * Constructs a new {@code JosmTextArea}. A default model is set, the initial string
+     * is null, and rows/columns are set to 0.
+     */
+    public JosmTextArea() {
+        this(null, null, 0, 0);
+    }
+
+    /**
+     * Constructs a new {@code JosmTextArea} with the specified text displayed.
+     * A default model is created and rows/columns are set to 0.
+     *
+     * @param text the text to be displayed, or null
+     */
+    public JosmTextArea(String text) {
+        this(null, text, 0, 0);
+    }
+
+    /**
+     * Constructs a new {@code JosmTextArea} with the given document model, and defaults
+     * for all of the other arguments (null, 0, 0).
+     *
+     * @param doc  the model to use
+     */
+    public JosmTextArea(Document doc) {
+        this(doc, null, 0, 0);
+    }
+
+    /**
+     * Constructs a new empty {@code JosmTextArea} with the specified number of
+     * rows and columns. A default model is created, and the initial
+     * string is null.
+     *
+     * @param rows the number of rows >= 0
+     * @param columns the number of columns >= 0
+     * @exception IllegalArgumentException if the rows or columns
+     *  arguments are negative.
+     */
+    public JosmTextArea(int rows, int columns) {
+        this(null, null, rows, columns);
+    }
+
+    /**
+     * Constructs a new {@code JosmTextArea} with the specified text and number
+     * of rows and columns. A default model is created.
+     *
+     * @param text the text to be displayed, or null
+     * @param rows the number of rows >= 0
+     * @param columns the number of columns >= 0
+     * @exception IllegalArgumentException if the rows or columns
+     *  arguments are negative.
+     */
+    public JosmTextArea(String text, int rows, int columns) {
+        this(null, text, rows, columns);
+    }
+
+    /**
+     * Constructs a new {@code JosmTextArea} with the specified number of rows
+     * and columns, and the given model.  All of the constructors
+     * feed through this constructor.
+     *
+     * @param doc the model to use, or create a default one if null
+     * @param text the text to be displayed, null if none
+     * @param rows the number of rows >= 0
+     * @param columns the number of columns >= 0
+     * @exception IllegalArgumentException if the rows or columns
+     *  arguments are negative.
+     */
+    public JosmTextArea(Document doc, String text, int rows, int columns) {
+        super(doc, text, rows, columns);
+        TextContextualPopupMenu.enableMenuFor(this);
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java	(revision 5886)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java	(revision 5886)
@@ -0,0 +1,82 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.widgets;
+
+import javax.swing.JTextField;
+import javax.swing.text.Document;
+
+/**
+ * Subclass of {@link JTextField} that adds a "native" context menu (cut/copy/paste/select all).
+ * @since 5885
+ */
+public class JosmTextField extends JTextField {
+
+    /**
+     * Constructs a new <code>JosmTextField</code> that uses the given text
+     * storage model and the given number of columns.
+     * This is the constructor through which the other constructors feed.
+     * If the document is <code>null</code>, a default model is created.
+     *
+     * @param doc  the text storage to use; if this is <code>null</code>,
+     *      a default will be provided by calling the
+     *      <code>createDefaultModel</code> method
+     * @param text  the initial string to display, or <code>null</code>
+     * @param columns  the number of columns to use to calculate 
+     *   the preferred width >= 0; if <code>columns</code>
+     *   is set to zero, the preferred width will be whatever
+     *   naturally results from the component implementation
+     * @exception IllegalArgumentException if <code>columns</code> < 0
+     */
+    public JosmTextField(Document doc, String text, int columns) {
+        super(doc, text, columns);
+        TextContextualPopupMenu.enableMenuFor(this);
+    }
+
+    /**
+     * Constructs a new <code>JosmTextField</code> initialized with the
+     * specified text and columns.  A default model is created.
+     *
+     * @param text the text to be displayed, or <code>null</code>
+     * @param columns  the number of columns to use to calculate 
+     *   the preferred width; if columns is set to zero, the
+     *   preferred width will be whatever naturally results from
+     *   the component implementation
+     */
+    public JosmTextField(String text, int columns) {
+        this(null, text, columns);
+    }
+
+    /**
+     * Constructs a new <code>JosmTextField</code> initialized with the
+     * specified text. A default model is created and the number of
+     * columns is 0.
+     *
+     * @param text the text to be displayed, or <code>null</code>
+     */
+    public JosmTextField(String text) {
+        this(null, text, 0);
+    }
+
+    /**
+     * Constructs a new empty <code>JosmTextField</code> with the specified
+     * number of columns.
+     * A default model is created and the initial string is set to
+     * <code>null</code>.
+     *
+     * @param columns  the number of columns to use to calculate 
+     *   the preferred width; if columns is set to zero, the
+     *   preferred width will be whatever naturally results from
+     *   the component implementation
+     */ 
+    public JosmTextField(int columns) {
+        this(null, null, columns);
+    }
+
+    /**
+     * Constructs a new <code>JosmTextField</code>.  A default model is created,
+     * the initial string is <code>null</code>,
+     * and the number of columns is set to 0.
+     */
+    public JosmTextField() {
+        this(null, null, 0);
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuLauncher.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuLauncher.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuLauncher.java	(revision 5886)
@@ -2,4 +2,7 @@
 package org.openstreetmap.josm.gui.widgets;
 
+import java.awt.Component;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
@@ -13,4 +16,5 @@
 public class PopupMenuLauncher extends MouseAdapter {
     private final JPopupMenu menu;
+    private final boolean checkEnabled;
 
     /**
@@ -28,24 +32,24 @@
      */
     public PopupMenuLauncher(JPopupMenu menu) {
-        this.menu = menu;
+        this(menu, false);
     }
 
-    @Override
-    public void mousePressed(MouseEvent e) {
-        if (e.isPopupTrigger()) {
-            launch(e);
-        }
+    /**
+     * Creates a new {@link PopupMenuLauncher} with the given menu.
+     * @param menu The popup menu to display
+     * @param checkEnabled if {@code true}, the popup menu will only be displayed if the component triggering the mouse event is enabled
+     * @since 5885
+     */
+    public PopupMenuLauncher(JPopupMenu menu, boolean checkEnabled) {
+        this.menu = menu;
+        this.checkEnabled = checkEnabled;
     }
 
-    @Override
-    public void mouseClicked(MouseEvent e) {
-        if (e.isPopupTrigger()) {
-            launch(e);
-        }
-    }
-
-    @Override
-    public void mouseReleased(MouseEvent e) {
-        if (e.isPopupTrigger()) {
+    @Override public void mousePressed(MouseEvent e) { processEvent(e); }
+    @Override public void mouseClicked(MouseEvent e) { processEvent(e); }
+    @Override public void mouseReleased(MouseEvent e) { processEvent(e); }
+    
+    private void processEvent(MouseEvent e) {
+        if (e.isPopupTrigger() && (!checkEnabled || e.getComponent().isEnabled())) {
             launch(e);
         }
@@ -57,10 +61,21 @@
      * @param evt A mouse event
      */
-    public void launch(MouseEvent evt) {
+    public void launch(final MouseEvent evt) {
         if (menu != null) {
-            menu.show(evt.getComponent(), evt.getX(), evt.getY());
+            final Component component = evt.getComponent();
+            if (component != null && component.isFocusable() && !component.hasFocus() && component.requestFocusInWindow()) {
+                component.addFocusListener(new FocusListener() {
+                    @Override public void focusLost(FocusEvent e) {}
+                    @Override public void focusGained(FocusEvent e) {
+                        menu.show(component, evt.getX(), evt.getY());
+                        component.removeFocusListener(this);
+                    }
+                });
+            } else {
+                menu.show(component, evt.getX(), evt.getY());
+            }
         }
     }
-
+    
     /**
      * @return the popup menu if defined, {@code null} otherwise.
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 5886)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 5886)
@@ -0,0 +1,184 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.widgets;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Image;
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.ImageIcon;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.event.UndoableEditEvent;
+import javax.swing.event.UndoableEditListener;
+import javax.swing.text.DefaultEditorKit;
+import javax.swing.text.JTextComponent;
+import javax.swing.undo.CannotUndoException;
+import javax.swing.undo.UndoManager;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+/**
+ * A popup menu designed for text components. It displays the following actions:
+ * <ul>
+ * <li>Undo</li>
+ * <li>Cut</li>
+ * <li>Copy</li>
+ * <li>Paste</li>
+ * <li>Delete</li>
+ * <li>Select All</li>
+ * </ul>
+ * @since 5885
+ */
+public class TextContextualPopupMenu extends JPopupMenu {
+
+    protected JTextComponent component = null;
+    protected UndoAction undoAction = null;
+    
+    protected final PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
+        @Override public void propertyChange(PropertyChangeEvent evt) {
+            if (evt.getPropertyName().equals("editable")) {
+                removeAll();
+                addMenuEntries();
+            }
+        }
+    };
+    
+    /**
+     * Creates a new {@link TextContextualPopupMenu}.
+     */
+    protected TextContextualPopupMenu() {
+    }
+
+    /**
+     * Attaches this contextual menu to the given text component.
+     * A menu can only be attached to a single component.
+     * @param component The text component that will display the menu and handle its actions.
+     * @return {@code this}
+     * @see #detach(JTextComponent)
+     */
+    protected TextContextualPopupMenu attach(JTextComponent component) {
+        if (component != null && !isAttached()) {
+            this.component = component;
+            if (component.isEditable()) {
+                undoAction = new UndoAction();
+                component.getDocument().addUndoableEditListener(undoAction);
+            }
+            addMenuEntries();
+            component.addPropertyChangeListener("editable", propertyChangeListener);
+        }
+        return this;
+    }
+    
+    private void addMenuEntries() {
+        if (component.isEditable()) {
+            add(new JMenuItem(undoAction));
+            addSeparator();
+            addMenuEntry(component, tr("Cut"), DefaultEditorKit.cutAction, null);
+        }
+        addMenuEntry(component, tr("Copy"), DefaultEditorKit.copyAction, "copy");
+        if (component.isEditable()) {
+            addMenuEntry(component, tr("Paste"), DefaultEditorKit.pasteAction, "paste");
+            addMenuEntry(component, tr("Delete"), DefaultEditorKit.deleteNextCharAction, null);
+        }
+        addSeparator();
+        addMenuEntry(component, tr("Select All"), DefaultEditorKit.selectAllAction, null);
+    }
+    
+    /**
+     * Detaches this contextual menu from its text component.
+     * @return {@code this}
+     * @see #attach(JTextComponent)
+     */
+    protected TextContextualPopupMenu detach() {
+        if (isAttached()) {
+            component.removePropertyChangeListener("editable", propertyChangeListener);
+            removeAll();
+            if (undoAction != null) {
+                component.getDocument().removeUndoableEditListener(undoAction);
+                undoAction = null;
+            }
+            this.component = null;
+        }
+        return this;
+    }
+    
+    /**
+     * Creates a new {@link TextContextualPopupMenu} and enables it for the given text component.
+     * @param component The component that will display the menu and handle its actions.
+     * @return The {@link PopupMenuLauncher} responsible of displaying the popup menu. 
+     *         Call {@link #disableMenuFor} with this object if you want to disable the menu later.
+     * @see #disableMenuFor(JTextComponent, PopupMenuLauncher)
+     */
+    public static PopupMenuLauncher enableMenuFor(JTextComponent component) {
+        PopupMenuLauncher launcher = new PopupMenuLauncher(new TextContextualPopupMenu().attach(component), true);
+        component.addMouseListener(launcher);
+        return launcher;
+    }
+
+    /**
+     * Disables the {@link TextContextualPopupMenu} attached to the given popup menu launcher and text component. 
+     * @param component The component that currently displays the menu and handles its actions.
+     * @param launcher The {@link PopupMenuLauncher} obtained via {@link #enableMenuFor}.
+     * @see #enableMenuFor(JTextComponent)
+     */
+    public static void disableMenuFor(JTextComponent component, PopupMenuLauncher launcher) {
+        if (launcher.getMenu() instanceof TextContextualPopupMenu) {
+            ((TextContextualPopupMenu) launcher.getMenu()).detach();
+            component.removeMouseListener(launcher);
+        }
+    }
+
+    /**
+     * Determines if this popup is currently attached to a component.
+     * @return {@code true} if this popup is currently attached to a component, {@code false} otherwise.
+     */
+    public final boolean isAttached() {
+        return component != null;
+    }
+
+    protected void addMenuEntry(JTextComponent component,  String label, String actionName, String iconName) {
+        Action action = component.getActionMap().get(actionName);
+        if (action != null) {
+            JMenuItem mi = new JMenuItem(action);
+            mi.setText(label);
+            if (iconName != null && Main.pref.getBoolean("text.popupmenu.useicons", true)) {
+                ImageIcon icon = ImageProvider.get(iconName);
+                if (icon != null) {
+                    mi.setIcon(new ImageIcon(icon.getImage().getScaledInstance(16 , 16, Image.SCALE_SMOOTH)));
+                }
+            }
+            add(mi);
+        }
+    }
+    
+    protected class UndoAction extends AbstractAction implements UndoableEditListener {
+        
+        private final UndoManager undoManager = new UndoManager();
+        
+        public UndoAction() {
+            super(tr("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) {
+                // Ignored
+            } finally {
+                setEnabled(undoManager.canUndo());
+            }
+        }
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/io/GpxExporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 5886)
@@ -22,6 +22,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
 import javax.swing.ListSelectionModel;
 
@@ -34,4 +32,6 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.GBC;
@@ -42,4 +42,7 @@
         + tr("Note: GPL is not compatible with the OSM license. Do not upload GPL licensed tracks.") + "</html>";
 
+    /**
+     * Constructs a new {@code GpxExporter}.
+     */
     public GpxExporter() {
         super(GpxImporter.FILE_FILTER);
@@ -81,5 +84,5 @@
 
         p.add(new JLabel(tr("GPS track description")), GBC.eol());
-        JTextArea desc = new JTextArea(3, 40);
+        JosmTextArea desc = new JosmTextArea(3, 40);
         desc.setWrapStyleWord(true);
         desc.setLineWrap(true);
@@ -91,13 +94,13 @@
         JLabel nameLabel = new JLabel(tr("Real name"));
         p.add(nameLabel, GBC.std().insets(10, 0, 5, 0));
-        JTextField authorName = new JTextField();
+        JosmTextField authorName = new JosmTextField();
         p.add(authorName, GBC.eol().fill(GBC.HORIZONTAL));
         JLabel emailLabel = new JLabel(tr("E-Mail"));
         p.add(emailLabel, GBC.std().insets(10, 0, 5, 0));
-        JTextField email = new JTextField();
+        JosmTextField email = new JosmTextField();
         p.add(email, GBC.eol().fill(GBC.HORIZONTAL));
         JLabel copyrightLabel = new JLabel(tr("Copyright (URL)"));
         p.add(copyrightLabel, GBC.std().insets(10, 0, 5, 0));
-        JTextField copyright = new JTextField();
+        JosmTextField copyright = new JosmTextField();
         p.add(copyright, GBC.std().fill(GBC.HORIZONTAL));
         JButton predefined = new JButton(tr("Predefined"));
@@ -105,5 +108,5 @@
         JLabel copyrightYearLabel = new JLabel(tr("Copyright year"));
         p.add(copyrightYearLabel, GBC.std().insets(10, 0, 5, 5));
-        JTextField copyrightYear = new JTextField("");
+        JosmTextField copyrightYear = new JosmTextField("");
         p.add(copyrightYear, GBC.eol().fill(GBC.HORIZONTAL));
         JLabel warning = new JLabel("<html><font size='-2'>&nbsp;</html");
@@ -113,5 +116,5 @@
 
         p.add(new JLabel(tr("Keywords")), GBC.eol());
-        JTextField keywords = new JTextField();
+        JosmTextField keywords = new JosmTextField();
         keywords.setText((String) gpxData.attr.get(META_KEYWORDS));
         p.add(keywords, GBC.eop().fill(GBC.HORIZONTAL));
@@ -184,6 +187,6 @@
     }
 
-    private static void enableCopyright(final GpxData data, final JTextField copyright, final JButton predefined,
-            final JTextField copyrightYear, final JLabel copyrightLabel, final JLabel copyrightYearLabel,
+    private static void enableCopyright(final GpxData data, final JosmTextField copyright, final JButton predefined,
+            final JosmTextField copyrightYear, final JLabel copyrightLabel, final JLabel copyrightYearLabel,
             final JLabel warning, boolean enable) {
         copyright.setEnabled(enable);
@@ -227,9 +230,9 @@
             final GpxData data,
             final JCheckBox author,
-            final JTextField authorName,
-            final JTextField email,
-            final JTextField copyright,
+            final JosmTextField authorName,
+            final JosmTextField email,
+            final JosmTextField copyright,
             final JButton predefined,
-            final JTextField copyrightYear,
+            final JosmTextField copyrightYear,
             final JLabel nameLabel,
             final JLabel emailLabel,
Index: /trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java	(revision 5886)
@@ -30,5 +30,4 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
 import javax.swing.SwingConstants;
 
@@ -36,4 +35,5 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.io.GpxWriter;
 import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport;
@@ -79,5 +79,5 @@
         final File file = layer.getAssociatedFile();
         if (file != null) {
-            JTextField tf = new JTextField();
+            JosmTextField tf = new JosmTextField();
             tf.setText(file.getPath());
             tf.setEditable(false);
Index: /trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java	(revision 5886)
@@ -32,5 +32,4 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JTextField;
 import javax.swing.SwingConstants;
 
@@ -41,4 +40,5 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.io.OsmWriter;
 import org.openstreetmap.josm.io.OsmWriterFactory;
@@ -109,5 +109,5 @@
         final JButton save = new JButton(saveAction);
         if (file != null) {
-            JTextField tf = new JTextField();
+            JosmTextField tf = new JosmTextField();
             tf.setText(file.getPath());
             tf.setEditable(false);
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 5886)
@@ -45,5 +45,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 import javax.swing.UIManager;
 
@@ -59,4 +58,5 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.GBC;
@@ -1200,5 +1200,5 @@
                         b.append("\n");
                     }
-                    JTextArea a = new JTextArea(10, 40);
+                    JosmTextArea a = new JosmTextArea(10, 40);
                     a.setEditable(false);
                     a.setText(b.toString());
@@ -1209,5 +1209,5 @@
             }), GBC.eol());
 
-            JTextArea description = new JTextArea((info.description == null ? tr("no description available")
+            JosmTextArea description = new JosmTextArea((info.description == null ? tr("no description available")
                     : info.description));
             description.setEditable(false);
Index: /trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 5885)
+++ /trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 5886)
@@ -19,5 +19,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 import javax.swing.SwingUtilities;
 
@@ -26,4 +25,5 @@
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.JMultilineLabel;
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.plugins.PluginHandler;
 
@@ -151,5 +151,5 @@
                             }
 
-                            JTextArea info = new JTextArea(text, 18, 60);
+                            JosmTextArea info = new JosmTextArea(text, 18, 60);
                             info.setCaretPosition(0);
                             info.setEditable(false);
