• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Repaint not working inside actionperformed!! need help please .

 
mars anem
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code of my program, I don't know what is the problem. I would really appreciate the help. thank you :-)




mapaZac.jpg
[Thumbnail for mapaZac.jpg]
image of background
play.jpg
[Thumbnail for play.jpg]
image for button
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello mars, and welcome to JavaRanch! I've taken the liberty of editing your post and adding code tags so that the code will retain its formatting and be readable. To learn how to do this yourself, please check out the FAQ section including HowToAskQuestionsOnJavaRanch and UseCodeTags.

Much luck and again, welcome!
 
mars anem
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, I will read about code tags :-)
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Concurrency in Swing. In other words, the repaint will be done - as soon as the run method ends.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, realize that the code executing in the main method is not in the Event Dispatch thread (EDT).
You really shouldn't do any Swing work outside of the EDT. The article referenced by Rob is a great place to read about this and how to do it properly.
 
mars anem
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both, I will read the article on concurrence in swing .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic