Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Can java applet be as big as the browser window

  1. Feb 22, 2008 #1
    Here's a java applet that shows the electric field of a moving charge (it's actually incorrect, it only gives a rough idea how motion and acceleration affect electric field).


    Can a java applet like this be the same size as the browser window at all times?
  2. jcsd
  3. Feb 22, 2008 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    It might be a little tricky to get resizing working properly, but yes, it should be possible. If you intend to run it full-screen, though, you might as well run it with Java's appletviewer program instead.

    - Warren
  4. Feb 23, 2008 #3


    User Avatar
    Science Advisor

    Try using 100% for the width and height on the applet's html tag.

    It's also possible to dynamically write a Java applet's tag onto the page using Javascript. So you can obtain the window dimensions in javascript, and then write the applet's tag with the appropriate width/height (you'd need to update the dimensions on page resize, using onresize) - not ideal but it's an option.
    Last edited: Feb 23, 2008
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Similar Threads for java applet browser
Why is my old browser faster than newer versions?