Wrong Applet size

Hi, all. Quick question about Applets. (I’m a convert after years of using WebStart. :wink: )

I’m launching an Applet with:

<applet ... width="512" height="384"></applet>

But then when the Applet runs,

public class MyApplet extends Applet {
  public void init() {
    System.out.println("Size: " + getWidth() + " x " + getHeight());
    // etc.
  }
}

its size is slightly larger than I specified (e.g., 534x400).

Can anyone tell my why this is? And is there a simple fix for it?

I’m seeing the problem on IE8, but not Chrome. (Yeah, I know. Obvious answer: don’t use IE8.)

Thanks,
Simon

If you take a screenshot, and measure the applet, is it still bigger?

Have you tried using JApplet and see if its the still the same problem?

also check that you don’t have a zoom feature enabled on the browser (or at least set to 100%) as that can also make the applet bigger.

Wow, good call! I must’ve accidentally modified that at some point (Ctrl + Scroll wheel, isn’t it?). Setting it back to the default (View -> Zoom -> 100%) has made my Applet happy again.
;D
Thanks for the help!
Simon