1,105,197 Community Members

how to control the size of applet

Member Avatar
and12
Light Poster
37 posts since Aug 2009
Reputation Points: -8 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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:
http://blogfriendlyzone.webs.com/WheelOfFortune/WheelOfFortune.html

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.

Member Avatar
Dukane
Posting Whiz in Training
284 posts since Oct 2006
Reputation Points: 25 [?]
Q&As Helped to Solve: 29 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
llemes4011
Posting Whiz in Training
224 posts since Aug 2008
Reputation Points: 31 [?]
Q&As Helped to Solve: 13 [?]
Skill Endorsements: 0 [?]
 
0
 

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 >.< )

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article