I have subclassed a JPanel to draw animated gifs on, like an image viewer kind of thing. As I redraw different gifs on the panel, they begin to display slower and slower to the point where I have to close the program. How can I prevent this from happening?
class ImagePanel extends JPanel { Toolkit tk = Toolkit.getDefaultToolkit(); Font f = new Font("Ariel",Font.ITALIC, 24); JPanel draw = new JPanel(true);