Flip Book Animation, Flips image every 200 ms

Hi! Please help, my Jython script below is not working. I dont know what to do…

# FlipBookAnim.py
# 2006 February 16

class FlipBookAnim(ActionListener, Runnable):
    "A flip-book animation implementation"
    
    __delay = 200
    
    def __init__ (self):
        self.__view = ImageViewer()
        self.__book = ImageVector()
        self.__timer = Timer(FlipBookAnim.__delay, self)
        
        window = JFrame("Flip Book Animator", size=(300, 300), defaultCloseOperation=WindowConstants.EXIT_ON_CLOSE)
        window.setLayout(GridLayout(1, 1))
        window.add(self.__view)
        window.setVisible(1)
        
        image = ImageIcon("images/loading-msg.gif").getImage()
        self.__view.viewImage(image)
        
        i = 1
        while i <= 10:
            image = ImageIcon("images/beans/t%s.gif" %i).getImage()
            self.__book.addImage(image)
            
            i = i + 1
            
        self.__view.viewImage(None)
        
    def run(self):
        self.__timer.start()
        
    def actionPerformed(self, e):
        self.__view.viewImage(self.__book.flip())

if __name__ == "__main__":
    runner = FlipBookAnim()
    EventQueue.invokeLater(runner)