diff --git a/java/src/com/tightvnc/vncviewer/VncCanvas.java b/java/src/com/tightvnc/vncviewer/VncCanvas.java
index a457469..d3a4070 100644
--- a/java/src/com/tightvnc/vncviewer/VncCanvas.java
+++ b/java/src/com/tightvnc/vncviewer/VncCanvas.java
@@ -77,6 +77,7 @@
   int[] zrleTilePixels24;
   ZlibInStream zrleInStream;
   boolean zrleRecWarningShown = false;
+  boolean isFirstSizeAutoUpdate = true;
 
   // Zlib encoder's data.
   byte[] zlibBuf;
@@ -263,10 +264,28 @@
     int fbWidth = rfb.framebufferWidth;
     int fbHeight = rfb.framebufferHeight;
 
+    // FIXME: This part of code must be in VncViewer i think
     if (viewer.options.autoScale) {
-      if (!(maxWidth > 0 && maxHeight > 0)) {
-        maxWidth = fbWidth;
-        maxHeight = fbHeight;
+      if (viewer.inAnApplet) {
+        maxWidth = viewer.getWidth();
+        maxHeight = viewer.getHeight();
+      } else {
+        if (viewer.vncFrame != null) {
+          if (isFirstSizeAutoUpdate) {
+            isFirstSizeAutoUpdate = false;
+            Dimension screenSize = viewer.vncFrame.getToolkit().getScreenSize();
+            maxWidth = (int)screenSize.getWidth() - 100;
+            maxHeight = (int)screenSize.getHeight() - 100;            
+            viewer.vncFrame.setSize(maxWidth, maxHeight);
+          } else {
+            viewer.desktopScrollPane.doLayout();
+            maxWidth = viewer.desktopScrollPane.getWidth();
+            maxHeight = viewer.desktopScrollPane.getHeight();
+          }
+        } else {
+          maxWidth = fbWidth;
+          maxHeight = fbHeight;
+        }
       }
       int f1 = maxWidth * 100 / fbWidth;
       int f2 = maxHeight * 100 / fbHeight;
@@ -322,10 +341,18 @@
     pixelsSource.setAnimated(true);
     rawPixelsImage = Toolkit.getDefaultToolkit().createImage(pixelsSource);
 
+    // FIXME: This part of code must be in VncViewer i think
     // Update the size of desktop containers.
     if (viewer.inSeparateFrame) {
-      if (viewer.desktopScrollPane != null)
-	resizeDesktopFrame();
+      if (viewer.desktopScrollPane != null) {
+        if (!viewer.options.autoScale) {
+          resizeDesktopFrame();
+        } else {
+          setSize(scaledWidth, scaledHeight);
+          viewer.desktopScrollPane.setSize(maxWidth + 200,
+                                           maxHeight + 200);
+        }
+      }
     } else {
       setSize(scaledWidth, scaledHeight);
     }
diff --git a/java/src/com/tightvnc/vncviewer/VncViewer.java b/java/src/com/tightvnc/vncviewer/VncViewer.java
index c6fa157..7b913b3 100644
--- a/java/src/com/tightvnc/vncviewer/VncViewer.java
+++ b/java/src/com/tightvnc/vncviewer/VncViewer.java
@@ -33,7 +33,7 @@
 import java.net.*;
 
 public class VncViewer extends java.applet.Applet
-  implements java.lang.Runnable, WindowListener {
+  implements java.lang.Runnable, WindowListener, ComponentListener {
 
   boolean inAnApplet = true;
   boolean inSeparateFrame = false;
@@ -127,8 +127,10 @@
     cursorUpdatesDef = null;
     eightBitColorsDef = null;
 
-    if (inSeparateFrame)
+    if (inSeparateFrame) {
       vncFrame.addWindowListener(this);
+      vncFrame.addComponentListener(this);
+    }
 
     rfbThread = new Thread(this);
     rfbThread.start();
@@ -195,6 +197,11 @@
 	gbc.fill = GridBagConstraints.BOTH;
 	gridbag.setConstraints(desktopScrollPane, gbc);
 	desktopScrollPane.add(canvasPanel);
+        // If auto scale is not enabled we don't need to set first frame
+        // size to fullscreen
+        if (!options.autoScale) {
+          vc.isFirstSizeAutoUpdate = false;
+        }
 
 	// Finally, add our ScrollPane to the Frame window.
 	vncFrame.add(desktopScrollPane);
@@ -203,12 +210,10 @@
 	vc.resizeDesktopFrame();
 
       } else {
-
 	// Just add the VncCanvas component to the Applet.
 	gridbag.setConstraints(vc, gbc);
 	add(vc);
 	validate();
-
       }
 
       if (showControls) {
@@ -985,6 +990,30 @@
   public void enableInput(boolean enable) {
     vc.enableInput(enable);
   }
+  
+  //
+  // Resize framebuffer if autoScale is enabled.
+  //
+  
+  public void componentResized(ComponentEvent e) {
+    if (e.getComponent() == vncFrame) {
+      if (options.autoScale) {
+        if (vc != null) {
+          if (!vc.isFirstSizeAutoUpdate) {
+            vc.updateFramebufferSize();
+          }
+        }
+      }
+    }
+  }
+  
+  //
+  // Ignore component events we're not interested in.
+  //
+  
+  public void componentShown(ComponentEvent e) { }
+  public void componentMoved(ComponentEvent e) { }
+  public void componentHidden(ComponentEvent e) { }
 
   //
   // Close application properly on window close event.
