This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes Applet size issue in JRE 1.5.0_15?    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet size issue in JRE 1.5.0_15?    " Watch "Applet size issue in JRE 1.5.0_15?    " New topic
Author

Applet size issue in JRE 1.5.0_15?

Chinh Tran Nam
Ranch Hand

Joined: Nov 08, 2004
Posts: 35
Hi All,

I have an applet with both WIDTH and HEIGHT = 100% as parameters. It works OK in previous JRE versions.
But when I upgraded to JRE 1.5.0_15, I saw strange issue: The applet height sometimes did not stretch full browser height, it looked as if the applet corrupted. I added some debug code to init() and start() events the applet and found that the getBounds().height returned different values; sometimes correct value (browser's height), sometimes not.

Anyone encountered the same issue? Do you have any solution or advice?

Thanks,
Chinh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41040
    
  43
The width and height attributes take pixels, not percentages. If you want to have the applet stretch for the full screen size you'll need to run some JavaScript code that determines those sizes, and which then creates an applet tag with the corresponding width and height in pixels.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Applet size issue in JRE 1.5.0_15?
 
Similar Threads
applet resize issue with jre 1.5 versions
Error in generics
don't use any IDE for SCJP
How to use swings with applet
Applet Loading Issue