player.vncFrame.pack();
  void resizeDesktopFrame() {    // determine screen size    Dimension screenSize = player.vncFrame.getToolkit().getScreenSize();    Dimension scrollSize = player.desktopScrollPane.getSize();    // Reduce Screen Size by 30 pixels in each direction;    // This is a (poor) attempt to account for    //     1) Menu bar on Macintosh (should really also account for    //        Dock on OSX).  Usually 22px on top of screen.    //     2) Taxkbar on Windows (usually about 28 px on bottom)    //     3) Other obstructions.    screenSize.height -= 30;    screenSize.width -= 30;    // Further reduce the screen size to account for the    // scroll pane's insets.    Insets insets = player.desktopScrollPane.getInsets();    screenSize.height -= insets.top + insets.bottom;    screenSize.width -= insets.left + insets.right;    // Limit pane size to fit on screen.     boolean needResize = false;    if (scrollSize.width != rfb.framebufferWidth ||        scrollSize.height != rfb.framebufferHeight)      needResize = true;    int w = rfb.framebufferWidth, h = rfb.framebufferHeight;    if (w > screenSize.width) {      w = screenSize.width;      needResize = true;    }    if (h > screenSize.height) {      h = screenSize.height;      needResize = true;    }    if (needResize)      player.desktopScrollPane.setSize(w, h);    player.vncFrame.pack();    // size the canvas    setSize(getPreferredSize());  }