File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes watching an applet to draw waveform Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "watching an applet to draw waveform" Watch "watching an applet to draw waveform" New topic
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: 24183
    
  34

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: watching an applet to draw waveform