Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can you use two images and fade one into the other?

 
Klaas Vredevort
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey

Is it possible to use two pictures in java and fade one into another? like the one slowly fading away and the next one fading to the foreground?

Klaas
 
Matti Poro
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/docs/books/tutorial/2d/index.html

Override JPanel's paintComponent(Graphics g) method:



Then use a thread to increase or decrease the alpha value.
 
David Irwin
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Klaas Vredevort:
Hey

Is it possible to use two pictures in java and fade one into another? like the one slowly fading away and the next one fading to the foreground?

Klaas


This may not directly answer your question, but I've used the JGoodies animation library and it's quite cool. You may want to check it out and see if it's applicable to your needs.

Good luck!

Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic