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
Use a Swing Timer (not a TimerTask). When the Timer fires the code will execute in the EDT so you can safely reset the icon of your JLabel. So I would first create ImageIcons from your BufferedImages and store the Icons in your array.
Read the secton from the Swing tutorial on How to Use Timers for more information. You may also want to check out the section on Concurreny to understand why executing code in the EDT is important.
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(..);