HOME       >>       Programming

Java Applet Query


Roders1234

Hey there, I have made an applet that shows images moving about the screen. I have pause/resume buttons that work. But i've noticed that when the applet is interuppted by something i.e moving another window over it, it will automatically repaint.My question is how can I stop this? How can I make it so that the only time that paint is called is when I want it to be called?Thanks in advance!


CrashCore

Since no one has posted on this, I'll try a suggestion...Can the Graphics object be declared final or static, or something like that?I'm not sure if this would help, but it seems like the browser is always calling repaint() so I'm not sure if there is much you can do.


iGuest

You could make a new method:Something likePublic void drawIt(Graphics g){ g.DrawString(...Etc}And call it.I believe you can override the paint function by including:Public void paint(Graphics g){}In the code.



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.