Index: /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java
===================================================================
--- /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java	(revision 15827)
+++ /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java	(revision 15828)
@@ -60,9 +60,12 @@
 
     // Fields are declared here for easy access
-    private JMultilineLabel OutputDisplay = new JMultilineLabel("");
-    private JTextField descriptionField = new JTextField();
-    private JTextField tagsField = new JTextField();
+    // Do not remove the space in JMultilineLabel. Otherwise the label will be empty
+    // as we don't know its contents yet and therefore have a height of 0. This will
+    // lead to unnecessary scrollbars.
+    private JMultilineLabel OutputDisplay = new JMultilineLabel(" ");
+    private JTextField descriptionField = new JTextField(50);
+    private JTextField tagsField = new JTextField(50);
     private JCheckBox publicCheckbox = new JCheckBox();
-    
+
     // Constants used when generating upload request
     private static final String API_VERSION = "0.6";
@@ -74,5 +77,5 @@
     private String datename = new SimpleDateFormat("yyMMddHHmmss").format(new Date());
     private String filename = "";
-    
+
     private boolean cancelled = false;
 
@@ -86,13 +89,10 @@
         JPanel content = initComponents();
         autoSelectTrace();
-        
-        contentConstraints = GBC.eol().fill().insets(5,10,5,0);
+
         setupDialog(content, new String[] { "uploadtrace.png", "cancel.png" });
-        
+
         buttons.get(0).setEnabled(!checkForGPXLayer());
-        
-        setSize(findMaxDialogSize());
-    }
-    
+    }
+
     /**
      * Sets up the dialog window elements
@@ -109,6 +109,5 @@
         tagsField.setToolTipText(tr("Please enter tags about your trace."));
 
-        JPanel p = new JPanel();
-        p.setLayout(new GridBagLayout());
+        JPanel p = new JPanel(new GridBagLayout());
 
         OutputDisplay.setMaxWidth(findMaxDialogSize().width-10);
@@ -125,5 +124,5 @@
         return p;
     }
-    
+
     /**
      * This function will automatically select a GPX layer if it's the only one.
@@ -168,17 +167,17 @@
         if(checkForErrors(username, password, description, gpxData))
             return;
-        
+
         // Clean description/tags from disallowed chars
         description = description.replaceAll("[&?/\\\\]"," ");
         tags = tags.replaceAll("[&?/\\\\.,;]"," ");
-        
+
         // Set progress dialog to indeterminate while connecting
         Main.pleaseWaitDlg.progress.setValue(0);
-        Main.pleaseWaitDlg.setIndeterminate(true); 
+        Main.pleaseWaitDlg.setIndeterminate(true);
         Main.pleaseWaitDlg.currentAction.setText(tr("Connecting..."));
 
         try {
             // Generate data for upload
-            ByteArrayOutputStream baos  = new ByteArrayOutputStream();            
+            ByteArrayOutputStream baos  = new ByteArrayOutputStream();
             writeGpxFile(baos, "file", gpxData);
             writeField(baos, "description", description);
@@ -186,15 +185,15 @@
             writeField(baos, "public", isPublic ? "1" : "0");
             writeString(baos, "--" + BOUNDARY + "--" + LINE_END);
-            
-            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());            
+
+            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
             HttpURLConnection conn = setupConnection(baos.size());
-            
+
             Main.pleaseWaitDlg.progress.setMaximum(baos.size());
-            Main.pleaseWaitDlg.setIndeterminate(false); 
-            
+            Main.pleaseWaitDlg.setIndeterminate(false);
+
             try {
                 flushToServer(bais, conn.getOutputStream());
             } catch(Exception e) {}
-            
+
             if(cancelled) {
                 conn.disconnect();
@@ -203,5 +202,5 @@
                 cancelled = false;
             } else {
-                boolean success = finishUpConnection(conn);            
+                boolean success = finishUpConnection(conn);
                 buttons.get(0).setEnabled(!success);
                 if(success)
@@ -213,5 +212,5 @@
         }
     }
-    
+
     /**
      * This function sets up the upload URL and logs in using the username and password given
@@ -225,8 +224,8 @@
         String auth = username + ":" + password;
         ByteBuffer bytes = encoder.encode(CharBuffer.wrap(auth));
-        
+
         // Upload URL
         URL url = new URL("http://www.openstreetmap.org/api/" + API_VERSION + "/gpx/create");
-        
+
         // Set up connection and log in
         HttpURLConnection c = (HttpURLConnection) url.openConnection();
@@ -235,17 +234,17 @@
         c.setRequestMethod("POST");
         c.setDoOutput(true);
-        c.addRequestProperty("Authorization", "Basic " + Base64.encode(bytes));            
+        c.addRequestProperty("Authorization", "Basic " + Base64.encode(bytes));
         c.addRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
         c.addRequestProperty("Connection", "close"); // counterpart of keep-alive
         c.addRequestProperty("Expect", "");
         c.connect();
-        
+
         return c;
     }
-    
+
     /**
      * This function checks if the given connection finished up fine, closes it and returns the result.
      * It also posts the result (or errors) to OutputDisplay.
-     
+
      * @param HttpURLConnection The connection to check/finish up
      */
@@ -253,10 +252,10 @@
         String returnMsg = c.getResponseMessage();
         boolean success = returnMsg.equals("OK");
-        
+
         if (c.getResponseCode() != 200) {
             if (c.getHeaderField("Error") != null)
                 returnMsg += "\n" + c.getHeaderField("Error");
         }
-        
+
         OutputDisplay.setText(success
             ? tr("GPX upload was successful")
@@ -266,5 +265,5 @@
         return success;
     }
-    
+
     /**
      * Uploads a given InputStream to a given OutputStream and sets progress
@@ -274,25 +273,25 @@
     private void flushToServer(InputStream in, OutputStream out) throws Exception {
         // Upload in 10 kB chunks
-		byte[] buffer = new byte[10000];
-		int nread;
-		int cur = 0;
-		synchronized (in) {
-			while ((nread = in.read(buffer, 0, buffer.length)) >= 0) {
-				out.write(buffer, 0, nread);
-				cur += nread;
+        byte[] buffer = new byte[10000];
+        int nread;
+        int cur = 0;
+        synchronized (in) {
+            while ((nread = in.read(buffer, 0, buffer.length)) >= 0) {
+                out.write(buffer, 0, nread);
+                cur += nread;
                 out.flush();
                 Main.pleaseWaitDlg.progress.setValue(cur);
                 Main.pleaseWaitDlg.currentAction.setText(getProgressText(cur));
-                
+
                 if(cancelled)
                     break;
-			}
-		}
-		if(!cancelled)
+            }
+        }
+        if(!cancelled)
             out.flush();
         Main.pleaseWaitDlg.currentAction.setText("Waiting for server reply...");
-		buffer = null;
-	}
-    
+        buffer = null;
+    }
+
     /**
      * Generates the output string displayed in the PleaseWaitDialog.
@@ -306,5 +305,5 @@
                         percent, formatBytes(cur), formatBytes(max));
     }
-    
+
     /**
      * Nicely calculates given bytes into MB, kB and B (with units)
@@ -351,5 +350,5 @@
 
     /**
-     * Checks if a GPX layer is selected and returns the result. Also writes an error 
+     * Checks if a GPX layer is selected and returns the result. Also writes an error
      * message to OutputDisplay if result is false.
      * @return boolean True, if /no/ GPX layer is selected
@@ -366,5 +365,5 @@
     }
 
-    
+
     /**
      * This creates the uploadTask that does the actual work and hands it to the main.worker to be executed.
@@ -372,5 +371,5 @@
     private void setupUpload() {
         if(checkForGPXLayer()) return;
-        
+
         // Disable Upload button so users can't just upload that track again
         buttons.get(0).setEnabled(false);
@@ -389,8 +388,8 @@
             }
         };
-        
+
         Main.worker.execute(uploadTask);
     }
-    
+
     /**
      * Writes textfields (like in webbrowser) to the given ByteArrayOutputStream
@@ -425,5 +424,5 @@
         writeLineEnd(baos);
     }
-    
+
     /**
      * Writes a String to the given ByteArrayOutputStream
@@ -436,5 +435,5 @@
         } catch(Exception e) {}
     }
-    
+
     /**
      * Writes a newline to the given ByteArrayOutputStream
@@ -444,5 +443,5 @@
         writeString(baos, LINE_END);
     }
-    
+
     /**
      * Writes a boundary line to the given ByteArrayOutputStream
@@ -453,5 +452,5 @@
         writeLineEnd(baos);
     }
-    
+
     /**
      * Returns the filename of the GPX file to be upload. If not available, returns current date
@@ -462,13 +461,5 @@
        return filename.equals("") ? datename : filename;
     }
-    
-    /**
-     * Defines a default size for the dialog
-     */
-    @Override protected Dimension findMaxDialogSize() {
-        setResizable(false);
-        return new Dimension(300, 230);
-    }
-    
+
     /**
      * Overrides the default actions. Will not close the window when upload trace is clicked
