How can I change the size of an Applet/JApplet in a Web Page?

Scott Stanchfield

Short answer: you can't.

The browser defines a fixed-sized area in the web page for the Applet. If you need dynamic sizing, your only choice is to have your Applet display a Frame, Window, or Dialog (or their Swing equivalents).

Note that just because the Applet doesn't change size, you should not avoid layout managers. Layout managers are still important because the components could appear different sizes based on the user's font settings or locale (if your program localizes).