• Post Reply Bookmark Topic Watch Topic
  • New Topic

repaint doesn't continue, no line but two point,why?

 
Forman Smith
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to page 384 of <head first java>, i modifyed the original code to below, i want to draw the line when i click the button.But the result is : just start point and the end point remain,no line show up.Why?

 
Knute Snortum
Sheriff
Posts: 3272
84
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing forum.
 
Darryl Burke
Bartender
Posts: 5155
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Forman and welcome to the Ranch! You're calling Thread#sleep(...) on the EDT, a big no-no. Learn about Swing Timers.

If you're not familiar with the EDT, look for the section of the same tutorial that deals with Concurrency in Swing.
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!