Jump to content
  • Advertisement
Sign in to follow this  
Nanven

Java+JavaScript

This topic is 5082 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone know if it is possible to use the DOM in javascript to change the size of a Java Applet dynamically? I've tried giving a name to the applet inside of the tag like: <applet name="SomeApplet" height=0 width=0></applet> And then trying to change it in javascript such as: document.layers["SomeApplet"].height = 100; document.layers["SomeApplet"].width = 100; But it returns an error saying document.layers.SomeApplet is null or not an object. So anyone know if there is a way to do this? Why would I want to do this? Well basically, change the size of an applet without reloading the page or the applet itself.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I suspect APPLET objects lie outside the DOM.

Might I suggest you take a look at Java WebStart instead? You still distribute your application via a website, but it opens in a new top-level window instead. You can resize the window as much as you like then, and the user can even close the browser and leave your application running.

WebStart HOW-TO:
http://wiki.java.net/bin/view/Games/HowToUseWebstart

Examples:
http://grexengine.com/sections/externalgames/tech-page-Webstart.html

--cfmdobbie

Share this post


Link to post
Share on other sites
Forget document.layers, that sounds like something out of Netscape4 DOM.

You MIGHT be able to do it using the proper dom functions, by manipulating the style of the applet (or object) element (Hint: use document.getElementById and then manipulate the style.width and height properties)

But don't hold your breath; Java applets aren't designed to be resized, so it might not work. Or it might just move around other elements on the page while leaving the applet the same size.

The same probably goes for Flash.

Mark

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!