Jump to content
xisto Community
Sign in to follow this  
Roders1234

Java Applet Query

Recommended Posts

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!

Edited by Roders1234 (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.