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).

    http://www.cco.caltech.edu/~phys1/java/phys1/MovingCharge/MovingCharge.html

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

    chroot

    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

    -Job-

    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
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Can java applet be as big as the browser window
  1. Can't open java applets (Replies: 10)

Loading...