Can java applet be as big as the browser window

  • Thread starter Ulysees
  • Start date
  • #1
516
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?
 

Answers and Replies

  • #2
chroot
Staff Emeritus
Science Advisor
Gold Member
10,239
37
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
 
  • #3
-Job-
Science Advisor
1,151
2
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:

Related Threads on Can java applet be as big as the browser window

  • Last Post
Replies
3
Views
989
Replies
8
Views
11K
  • Last Post
Replies
10
Views
4K
Replies
1
Views
11K
Replies
11
Views
2K
Replies
3
Views
916
Replies
4
Views
2K
Replies
35
Views
8K
Replies
4
Views
3K
  • Last Post
Replies
5
Views
2K
Top