Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Card Layout Manager and animated gif's  RSS feed

 
Rob Loft
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
has anyone had problems with putting animated gif's onto labels and then adding them to a panel and adding this panel to a card layout?
it would seem that the paint()mehtod is getting called randomly - and some icons show up and others dont?
any suggestions would be great.
cheers,
Rob.
 
Roger Brandt
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I am having the same problem with animated GIFs. I have a JApplet that contains a JPanel that contains a JLabel. The applet implements ActionListener and starts a javax.swing.Timer that ticks every 1/10th of a second. After 100 ticks (10 seconds), it changes the ImageIcon in the label. Some icons in the list are animated and some are not.
When the icon is changed to an animated icon, the animation only lasts for one tick, then the icon stops animating. In addition, if I invoke repaint() in the actionPerformed() method, the animated icons disappear.
Any suggestions? I am exploring the use of an ImageObserver.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!