i need code for drawing lines using concept of thread.
i have a button ,when user clicks on this ...line is drawn for random values.
the line is drawn dynamically.(using thread and sleep)i.e,,after a line is drawn between two points ,there is a slight delay seen when the line is drawn for next 2 points ,,,,
again when user clicks on the button. second line is plotted..and the first line which is bieng drawn also is visible.
Did you repaint the line between two points, may be after a delay, wait()?
have got no idea to accomplish this......
please give me the code...
i"ll get some information and idea
Sorry pal, I don't have any code related to this. What you have done up to now. It's better that you should ask your question related to work you have done.
Build your code a step at a time.
Do you have the code to draw a line? - use paintComponent()
Can you have the line drawn when a button is clicked? - listener
Now have a timer wait and then tell the line drawer to draw the next line. - have global flags to tell paint method what to draw.