Repainting/Updating in Applet
843807Oct 6 2004 — edited Oct 6 2004Hello.
I'm writing a program that I want to read information from a file, and then take that information and make a graphical "map" on the screen. Currently I'm using a simple Applet for this. I have a loadEnvironment() method which reads from the file. The idea is to update the Applet's graphics once the environment is loaded. However, I don't want to do this using the paint() method, because that is automatically called when the Applet is initialized. At the same time, though, I can't seem to call repaint() or update() from the loadEnvironment() method, which is what I want to do (what I mean is have the loadEnvironment() method cause the necessary graphics primitives to be drawn to the screen). So basically my first question is this - is there a way to do what I currently want to do with my program, or do I have to create another component? If I don't have to create another component, then what can I do?
Thanks a lot in advance!
- Rob