Two Laptop Bag
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
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

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?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
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.
I agree. Here's the link:
subject: Applet size issue in JRE 1.5.0_15?
It's not a secret anymore!