java - How do I synchronize calling of paint() with a button event? -


i writing application using awt in java.

i have button component in 1 class , canvas in class. canvas class has paint method. want is, when click button, canvas has updated, means paint() has redraw updated variables. (like want draw graph coordinates returned graph after click button).

for called function in actionperformed() (using object of canvas class) , defined function in canvas class. function updates variables(or can say, coordinates). variables don't updated after call repaint(), when click button nothing happens, graph doesn't drawn.

please me! have put code code complicated functions & variables called , updated multiple files.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -