Java Can java applet be as big as the browser window

  • Thread starter Thread starter Ulysees
  • Start date Start date
  • Tags Tags
    Java Window
AI Thread Summary
The discussion centers on a Java applet that illustrates the electric field of a moving charge, though it is noted that the applet only provides a rough approximation of how motion and acceleration influence the electric field. There is a query about whether the applet can maintain the same size as the browser window, with the consensus that it is possible but may require some effort to implement resizing correctly. A suggestion is made to use 100% for both width and height in the applet's HTML tag. Additionally, it is mentioned that JavaScript can be used to dynamically write the applet's tag based on the window dimensions, allowing for updates on page resize, although this method is considered less than ideal. For full-screen use, running the applet with Java's appletviewer is recommended.
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?
 
Technology 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:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
8
Views
11K
Replies
4
Views
5K
Replies
4
Views
3K
Replies
2
Views
2K
Replies
6
Views
2K
Replies
34
Views
54K
Replies
11
Views
4K
Back
Top