How can you stop flicker on image change?
Hi, I have created an application that has a class extended from JPanel that lets me change image being displayed with overriding draw method. Every time a button is pressed the image being displayed in that panel will change. When this happens there is a very noticable flicker.
I thought it might have been because I am overriding paint in that one customised JPanel class but I commented it out and the issue happens all the same when an image would have been changed.
If anyone could help me figure this out that would be very helpful. I tried to detail the situation so that I wouldn't need to post any code but if the case is that I do just say so.
It's not quite what's going on in this link
JAVA CODE SPOT: JAVA : Flickering Problem In Paint Method, it only happens when the button that would change the pic is clicked.
Re: How can you stop flicker on image change?
Can you make a small program that compiles, executes and show the problem?
Re: How can you stop flicker on image change?
I don't have time to do that until after tomorrow but if thats what I need to do to be helped I will do it then. Thanks for the reply.
Re: How can you stop flicker on image change?
Quote:
Originally Posted by
goatjugsoup
Hi, I have created an application that has a class extended from JPanel that lets me change image being displayed with overriding draw method.
JPanel doesn't have a draw method.
db
Re: How can you stop flicker on image change?
I did a quick google search and this link is kinda like what I'm doing
Java Swing: how to add an image to a JPanel? - Stack Overflow
If JPanel doesn't have a draw method what is it overriding then?
Re: How can you stop flicker on image change?
Can you make a small program that compiles, executes and show the problem?