Can java applet be as big as the browser window

  • Context: Java 
  • Thread starter Thread starter Ulysees
  • Start date Start date
  • Tags Tags
    Java Window
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 4K views
Ulysees
Messages
515
Reaction score
0
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?
 
Physics news on Phys.org
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
 
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: