I can't seem to control the size of the applet when it appears in the appletviewer and i assume that will be how it looks on the web.

Right now, on the web, my applet is too big:

When i run it as application, it obeys setSize to make it smaller or setExtended to fit the screen.

But regardless changing setSize to be smaller, the applet is still too big to show the whole game in appletviewer. It ignores setSize or setExtended.

I haven't been able to compile yet with toolkit(). It won't recognize that line.
Dimension d = Toolkit.getDefaultToolKit().getScreenSize();
But it keeps saying it cannot find symbol method getDefaultToolKit() and already import java.awt.* java.awt.Toolkit; java.lang.Object;

But i don't even know if that would control the size. As it is, the applicaiton is normal but the applet is not.

8 Years
Discussion Span
Last Post by llemes4011

Applet size on the web is controlled by the width and height attributes in the embed/object tag in your HTML page.


You need to take a closer look at that line. There is a very subtle mistake in there, that is very easy to make, and seems VERY natural to type... (I do it all the time >.< )

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.