The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2002



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Manipulate the width and height of OBJECT

Posted by Kishori Sharan on January 18, 2002 at 9:49 AM

Place your OBJECT tags which has applet within a HTML form. Suppose your form name is form1. Also supply a name to your OBJECT tag. Suppose the OBJECT name is a1. Write a Javascript function and include this code to change the width or height of JApplet. (I have tested the following code)
document.form1.a1.width = "your new width goes here"
document.form1.a1.height = "your new height goes here"

If you want to resize your applet using your mouse over the applet borders then you have to write Java code to do that. On mouse-move event check where the mouse pointer is. If the mouse pointer is on the border then start resizing the applet changing its width and height as required. You can also capture mouse-move event in Javascript and accomplish the same.



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us