Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java	(revision 2332)
@@ -114,5 +114,5 @@
                     Main.parent,
                     sb.toString(),
-                    tr("Errors during Download"),
+                    tr("Errors during download"),
                     JOptionPane.ERROR_MESSAGE);
             return;
Index: trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 2332)
@@ -25,5 +25,24 @@
     private static DecimalFormat cDdFormatter = new DecimalFormat("###0.0000");
 
+    /**
+     * Replies true if lat is in the range [-90,90]
+     * 
+     * @param lat the latitude 
+     * @return true if lat is in the range [-90,90]
+     */
+    public static boolean isValidLat(double lat) {
+        return lat >= -90d && lat <= 90d;
+    }
 
+    /**
+     * Replies true if lon is in the range [-180,180]
+     * 
+     * @param lon the longitude 
+     * @return true if lon is in the range [-180,180]
+     */
+    public static boolean isValidLon(double lon) {
+        return lon >= -180d && lon <= 180d;
+    }
+    
     public static String dms(double pCoordinate) {
 
Index: trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 2332)
@@ -18,4 +18,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.gui.BookmarkList;
@@ -100,9 +101,9 @@
     }
 
-    public void boundingBoxChanged(DownloadDialog gui) {
-        tempBookmark = new Preferences.Bookmark(gui.getSelectedDownloadArea());
+    
+    public void setDownloadArea(Bounds area) {
+        if (area == null) return;
+        tempBookmark = new Preferences.Bookmark(area);
         bookmarks.clearSelection();
     }
-
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java	(revision 2332)
@@ -4,18 +4,25 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.awt.event.FocusAdapter;
 import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-
+
+import javax.swing.BorderFactory;
 import javax.swing.JLabel;
+import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JTextArea;
 import javax.swing.JTextField;
-import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
-
+import javax.swing.text.JTextComponent;
+
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -33,43 +40,37 @@
 public class BoundingBoxSelection implements DownloadSelection {
 
-    private JTextField[] latlon = new JTextField[] {
-            new JTextField(11),
-            new JTextField(11),
-            new JTextField(11),
-            new JTextField(11) };
+    private JTextField[] latlon = null;
     final JTextArea osmUrl = new JTextArea();
     final JTextArea showUrl = new JTextArea();
 
+    
+    protected void buildDownloadAreaInputFields() {
+        latlon = new JTextField[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].addFocusListener(new SelectAllOnFocusHandler(latlon[i]));
+        }
+        LatValueChecker latChecker = new LatValueChecker(latlon[0]);
+        latlon[0].addFocusListener(latChecker);
+        latlon[0].addActionListener(latChecker);
+
+        latChecker = new LatValueChecker(latlon[3]);
+        latlon[2].addFocusListener(latChecker);
+        latlon[2].addActionListener(latChecker);
+        
+        LonValueChecker lonChecker = new LonValueChecker(latlon[1]);
+        latlon[1].addFocusListener(lonChecker);
+        latlon[1].addActionListener(lonChecker);
+
+        lonChecker = new LonValueChecker(latlon[3]);
+        latlon[3].addFocusListener(lonChecker);
+        latlon[3].addActionListener(lonChecker);
+        
+    }
+    
     public void addGui(final DownloadDialog gui) {
-
+        buildDownloadAreaInputFields();
         JPanel dlg = new JPanel(new GridBagLayout());
-
-        final FocusListener dialogUpdater = new FocusAdapter() {
-            @Override public void focusLost(FocusEvent e) {
-                SwingUtilities.invokeLater(new Runnable() {
-                    public void run() {
-                        try {
-                            double minlat = Double.parseDouble(latlon[0].getText());
-                            double minlon = Double.parseDouble(latlon[1].getText());
-                            double maxlat = Double.parseDouble(latlon[2].getText());
-                            double maxlon = Double.parseDouble(latlon[3].getText());
-                            Bounds b = new Bounds(minlat,minlon, maxlat,maxlon);
-                            if (gui.getSelectedDownloadArea() == null) return;
-                            if (gui.getSelectedDownloadArea() == null || !gui.getSelectedDownloadArea().equals(new Bounds(minlat,minlon, maxlat,maxlon))) {
-                                gui.boundingBoxChanged(b, BoundingBoxSelection.this);
-                            }
-                        } catch (NumberFormatException x) {
-                            // ignore
-                        }
-                        updateUrl(gui);
-                    }
-                });
-            }
-        };
-
-        for (JTextField f : latlon) {
-            f.setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height));
-            f.addFocusListener(dialogUpdater);
-        }
 
         class osmUrlRefresher implements DocumentListener {
@@ -84,13 +85,5 @@
         // windows look+feel but not for others. needs invokeLater to avoid strange
         // side effects that will cancel out the newly made selection otherwise.
-        osmUrl.addFocusListener(new FocusAdapter() {
-            @Override public void focusGained(FocusEvent e) {
-                SwingUtilities.invokeLater(new Runnable() {
-                    public void run() {
-                        osmUrl.selectAll();
-                    }
-                });
-            }
-        });
+        osmUrl.addFocusListener(new SelectAllOnFocusHandler(osmUrl));
         osmUrl.setLineWrap(true);
         osmUrl.setBorder(latlon[0].getBorder());
@@ -110,20 +103,29 @@
         showUrl.setEditable(false);
         showUrl.setBackground(dlg.getBackground());
-        showUrl.addFocusListener(new FocusAdapter(){
-            @Override
-            public void focusGained(FocusEvent e) {
-                showUrl.selectAll();
-            }
-        });
+        showUrl.addFocusListener(new SelectAllOnFocusHandler(showUrl));
 
         gui.addDownloadAreaSelector(dlg, tr("Bounding Box"));
     }
 
-    /**
-     * Called when bounding box is changed by one of the other download dialog tabs.
-     */
-    public void boundingBoxChanged(DownloadDialog gui) {
-        updateBboxFields(gui);
-        updateUrl(gui);
+    
+    public void setDownloadArea(Bounds area) {
+        updateBboxFields(area);
+        updateUrl(area);
+    }
+    
+    public Bounds getDownloadArea() {
+        double[] values = new double[4];
+        for (int i=0; i < 4; i++) {
+            try {
+                values[i] = Double.parseDouble(latlon[i].getText());
+            } catch(NumberFormatException x) {
+                return null;
+            }
+        }
+        if (!LatLon.isValidLat(values[0]) || !LatLon.isValidLon(values[1]))
+            return null;
+        if (!LatLon.isValidLat(values[2]) || !LatLon.isValidLon(values[3]))
+            return null;        
+        return new Bounds(values);
     }
 
@@ -132,16 +134,15 @@
         if(b == null) return false;        
         gui.boundingBoxChanged(b,BoundingBoxSelection.this);
-        updateBboxFields(gui);
-        updateUrl(gui);
+        updateBboxFields(b);
+        updateUrl(b);
         return true;
     }
 
-    private void updateBboxFields(DownloadDialog gui) {
-        Bounds b = gui.getSelectedDownloadArea();
-        if (b == null) return;
-        latlon[0].setText(Double.toString(b.getMin().lat()));
-        latlon[1].setText(Double.toString(b.getMin().lon()));
-        latlon[2].setText(Double.toString(b.getMax().lat()));
-        latlon[3].setText(Double.toString(b.getMax().lon()));
+    private void updateBboxFields(Bounds area) {
+        if (area == null) return;
+        latlon[0].setText(Double.toString(area.getMin().lat()));
+        latlon[1].setText(Double.toString(area.getMin().lon()));
+        latlon[2].setText(Double.toString(area.getMax().lat()));
+        latlon[3].setText(Double.toString(area.getMax().lon()));
         for (JTextField f : latlon) {
             f.setCaretPosition(0);
@@ -149,7 +150,109 @@
     }
 
-    private void updateUrl(DownloadDialog gui) {
-        if (gui.getSelectedDownloadArea() == null) return;
-        showUrl.setText(OsmUrlToBounds.getURL(gui.getSelectedDownloadArea()));
+    private void updateUrl(Bounds area) {
+        if (area == null) return;
+        showUrl.setText(OsmUrlToBounds.getURL(area));
+    }
+    
+    
+    class LatValueChecker extends FocusAdapter implements ActionListener{
+        private JTextField tfLatValue;
+        
+        private Border errorBorder = BorderFactory.createLineBorder(Color.RED, 1);
+        protected void setErrorMessage(String msg) {
+            if (msg != null) {
+                tfLatValue.setBorder(errorBorder);
+                tfLatValue.setToolTipText(msg);
+            } else {
+                tfLatValue.setBorder(UIManager.getBorder("TextField.border"));
+                tfLatValue.setToolTipText("");                
+            }
+        }
+     
+        public LatValueChecker(JTextField tfLatValue) {
+            this.tfLatValue = tfLatValue;
+        }
+        
+        protected void check() {
+            double value = 0;
+            try {
+                value = Double.parseDouble(tfLatValue.getText());
+            } catch(NumberFormatException ex) {
+                setErrorMessage(tr("The string ''{0}'' isn''t a valid double value.", tfLatValue.getText()));
+                return;
+            }
+            if (!LatLon.isValidLat(value)) {
+                JOptionPane.showMessageDialog(
+                        Main.parent,
+                        tr("Value for latitude in range [-90,90] required.", tfLatValue.getText()),
+                        tr("Error"),
+                        JOptionPane.ERROR_MESSAGE
+               );         
+                setErrorMessage(tr("Value for latitude in range [-90,90] required.", tfLatValue.getText()));
+                return;            
+            }
+        }
+        
+        @Override
+        public void focusLost(FocusEvent e) {
+            check();
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            check();            
+        }        
+    }
+    
+    class LonValueChecker extends FocusAdapter implements ActionListener {
+        private JTextField tfLonValue;
+        private Border errorBorder = BorderFactory.createLineBorder(Color.RED, 1);
+        protected void setErrorMessage(String msg) {
+            if (msg != null) {
+                tfLonValue.setBorder(errorBorder);
+                tfLonValue.setToolTipText(msg);
+            } else {
+                tfLonValue.setBorder(UIManager.getBorder("TextField.border"));
+                tfLonValue.setToolTipText("");                
+            }
+        }
+        
+        public LonValueChecker(JTextField tfLonValue) {
+            this.tfLonValue = tfLonValue;
+        }
+        
+        protected void check() {
+            double value = 0;
+            try {
+                value = Double.parseDouble(tfLonValue.getText());
+            } catch(NumberFormatException ex) {
+               setErrorMessage(tr("The string ''{0}'' isn''t a valid double value.", tfLonValue.getText()));
+               return;
+            }
+            if (!LatLon.isValidLon(value)) {
+                setErrorMessage(tr("Value for longitude in range [-180,180] required.", tfLonValue.getText()));
+                return;
+            }
+        }
+        
+        @Override
+        public void focusLost(FocusEvent e) {
+            check();
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            check();
+        }        
+    }
+    
+    class SelectAllOnFocusHandler extends FocusAdapter {
+        private JTextComponent tfTarget;
+        public SelectAllOnFocusHandler(JTextComponent tfTarget) {
+            this.tfTarget = tfTarget;            
+        }
+        
+        @Override
+        public void focusGained(FocusEvent e) {
+            tfTarget.selectAll();
+        }        
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 2332)
@@ -195,5 +195,5 @@
         for (DownloadSelection s : downloadSelections) {
             if (s != eventSource) {
-                s.boundingBoxChanged(this);
+                s.setDownloadArea(currentBounds);
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/download/DownloadSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/DownloadSelection.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/gui/download/DownloadSelection.java	(revision 2332)
@@ -2,6 +2,9 @@
 package org.openstreetmap.josm.gui.download;
 
+import org.openstreetmap.josm.data.Bounds;
 
-public interface DownloadSelection {
+
+public interface DownloadSelection  {
+
     /**
      * Add the GUI elements to the dialog.
@@ -9,9 +12,12 @@
     void addGui(DownloadDialog gui);
 
+    
     /**
-     * Update or clear display when a selection is made through another
-     * DownloadSelection object
+     * Sets the current download area. The area may be null to clear
+     * the current download area.
+     * 
+     * @param are the current download area
      */
-    void boundingBoxChanged(DownloadDialog gui);
+    public void setDownloadArea(Bounds area);
+}
 
-}
Index: trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 2332)
@@ -310,7 +310,5 @@
                          )
                     );
-                    updatingSelf = true;
                     gui.boundingBoxChanged(b,null);
-                    updatingSelf = false;
                 }
             }
@@ -332,9 +330,6 @@
     }
 
-    // if bounding box selected on other tab, de-select item
-    public void boundingBoxChanged(DownloadDialog gui) {
-        if (!updatingSelf) {
-            searchResultDisplay.clearSelection();
-        }
+    public void setDownloadArea(Bounds area) {
+       searchResultDisplay.clearSelection();
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java	(revision 2332)
@@ -166,17 +166,16 @@
     }
 
-    public void boundingBoxChanged(DownloadDialog gui) {
-        Bounds b = gui.getSelectedDownloadArea();
-        if (b == null)
+    public void setDownloadArea(Bounds area) {
+        if (area == null)
             return;
         
         // test if a bounding box has been set set
-        if (b.getMin().lat() == 0.0 && b.getMin().lon() == 0.0 && b.getMax().lat() == 0.0 && b.getMax().lon() == 0.0)
+        if (area.getMin().lat() == 0.0 && area.getMin().lon() == 0.0 && area.getMax().lat() == 0.0 && area.getMax().lon() == 0.0)
             return;
 
-        int y1 = OsmMercator.LatToY(b.getMin().lat(), MAX_ZOOM);
-        int y2 = OsmMercator.LatToY(b.getMax().lat(), MAX_ZOOM);
-        int x1 = OsmMercator.LonToX(b.getMin().lon(), MAX_ZOOM);
-        int x2 = OsmMercator.LonToX(b.getMax().lon(), MAX_ZOOM);
+        int y1 = OsmMercator.LatToY(area.getMin().lat(), MAX_ZOOM);
+        int y2 = OsmMercator.LatToY(area.getMax().lat(), MAX_ZOOM);
+        int x1 = OsmMercator.LonToX(area.getMin().lon(), MAX_ZOOM);
+        int x2 = OsmMercator.LonToX(area.getMax().lon(), MAX_ZOOM);
 
         iSelectionRectStart = new Point(Math.min(x1, x2), Math.min(y1, y2));
@@ -184,6 +183,6 @@
 
         // calc the screen coordinates for the new selection rectangle
-        MapMarkerDot xmin_ymin = new MapMarkerDot(b.getMin().lat(), b.getMin().lon());
-        MapMarkerDot xmax_ymax = new MapMarkerDot(b.getMax().lat(), b.getMax().lon());
+        MapMarkerDot xmin_ymin = new MapMarkerDot(area.getMin().lat(), area.getMin().lon());
+        MapMarkerDot xmax_ymax = new MapMarkerDot(area.getMax().lat(), area.getMax().lon());
 
         Vector<MapMarker> marker = new Vector<MapMarker>(2);
Index: trunk/src/org/openstreetmap/josm/gui/download/TileSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/TileSelection.java	(revision 2331)
+++ trunk/src/org/openstreetmap/josm/gui/download/TileSelection.java	(revision 2332)
@@ -87,20 +87,12 @@
     }
 
-    /**
-     * Called when bounding box is changed by one of the other download dialog tabs.
-     */
-    public void boundingBoxChanged(DownloadDialog gui) {
-        updateBboxFields(gui);
-    }
-
-    private void updateBboxFields(DownloadDialog gui) {
+    public void setDownloadArea(Bounds area) {
+        if (area == null)
+            return;
         int z = ((Integer) tileZ.getValue()).intValue();
-        Bounds b = gui.getSelectedDownloadArea();
-        if (b == null)
-            return;
-        tileX0.setText(Integer.toString(lonToTileX(z, b.getMin().lon())));
-        tileX1.setText(Integer.toString(lonToTileX(z, b.getMax().lon()-.00001)));
-        tileY0.setText(Integer.toString(latToTileY(z, b.getMax().lat()-.00001)));
-        tileY1.setText(Integer.toString(latToTileY(z, b.getMin().lat())));
+        tileX0.setText(Integer.toString(lonToTileX(z, area.getMin().lon())));
+        tileX1.setText(Integer.toString(lonToTileX(z, area.getMax().lon()-.00001)));
+        tileY0.setText(Integer.toString(latToTileY(z, area.getMax().lat()-.00001)));
+        tileY1.setText(Integer.toString(latToTileY(z, area.getMin().lat())));
     }
 
