Set applet's width to browser's width

The width of an applet is set via the "width" attribute of the applet tag, which is specified in pixels. I would like the width of the applet to be dynamic, such that it will take up the entire width of the browser's window. When the browser is resized, the applet will resize accordingly. Can this be achived? Thanks.
integrosysAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
try width 100%
0
 
CEHJCommented:
You'd need to use JavaScript for that
0
 
CEHJCommented:
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
integrosysAuthor Commented:
>> try width 100%

Isn't width specified in pixels?
0
 
objectsCommented:
can be either
0
 
ForceRsCommented:
objects is correct (width and height can be %).

To have mozilla browsers honor this, you must reload the page onResize:

<html>
<head>
<script language="JavaScript">
function resizer() {
      if(navigator.appName == 'Netscape') {
            history.go(0);
      } // end if
}
</script>
</head>

<body onResize="resizer();">
Your page's visual content.
</body>
</html>
0
 
integrosysAuthor Commented:
Thanks. The solution from objects works for me. Somehow, CEHJ's solution doesn't seem to work.
0
All Courses

From novice to tech pro — start learning today.