import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.*; import java.io.*; import javax.swing.ImageIcon; imp
You can create a TimerTask
class VideoTask extends TimerTask { private Frame frame; private int frameId; public void run() { frame.drawImage(....); frameId++; } }
And in the action listener for the button - schedule the task:
VideoTask videoTask = new VideoTask(frame); videoTask.schedule(..);