Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Repainting/Updating in Applet

843807Oct 6 2004 — edited Oct 6 2004
Hello.

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2004
Added on Oct 6 2004
1 comment
101 views