For my programming students, I'm looking for non-applet (and non-JApplet) science simulations written in java. Most simulations seem to be in applet or JApplet format. Any suggestions on where to look for simulations that would be interesting to programmers and science (physics, chemistry, biology, et cetera) students?
cheers! Bill
<wstanard@palmertrinity.org>
Ernest Friedman-Hill
author and iconoclast
Marshal
The important part of this is the main() method. I showed inside an entirely separate class, but you can just take the "public static void main() { ... }" part and put it into the WelcomeApplet class itself. Change "TheApplet" in my code to "WelcomeApplet", compile the applet, and then run the result with
java WelcomeApplet
from the command line.
Layne Lund
Ranch Hand
Joined: Dec 06, 2001
Posts: 3061
posted
0
Of course, if you don't want to "pollute" your applet class, you can use Ernest's example as a separate class in a separate file basically as it is.
Thanks, Ernest & Layne, It works... but... I need to grab and then resize the frame before it shows anything (in the case of the WelcomeApplet, the helloLabel). Any idea why this is? I've noticed it a lot with some of the applets I write, that text fields or labels are quite often hidden until the applet (frame) is grabbed and resized. Then all is well. cheers! Bill
Ernest Friedman-Hill
author and iconoclast
Marshal
Because the components are added after the applet is visible on the screen; the LayoutManager needs a special notification that you're done changing the screen before it actually does anything. You should be able to fix this by moving the init() call to just before the setVisible() call -- I suppose I've misled you in not doing it that way in the first place.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: looking for non-applet science simulations