| Author |
watching an applet to draw waveform
|
anteneh mamo
Greenhorn
Joined: Jul 05, 2007
Posts: 4
|
|
i've got a perfectly working applet , the problem is that my applet draws waveform reading the values from int []array, and the moment i press the draw button of the applet,it draws it instantly. ofcourse i can see the waveform by scrolling back to see the drawn waveform. but i want to be able to see the waveform while it is being drawn. i can understand why the compiler does this. could you suggest me a sort of delay mechanism or another. please i need it as quickly as possible. thank you in advance!
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
|
Basically you want to do animation. Instead of a paint method that draws the whole waveform, write a paint method that draws some part of the waveform, controlled by a numeric parameter. Create a thread which sleeps, updates the parameter, and calls repaint(). By controlling the sleep time, you control the rate at which the waveform will appear.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: watching an applet to draw waveform
|
|
|