Fading image rollover on JPanel

Hi there

How can I:

  1. Load in two images and draw one of them on a JPanel completely visible and draw the other one over it invisible
  2. When the mouse hovers over it fades the second image to 100% opacity
  3. When the mouse goes out it fades out

P.S. This is not an applet.

Thanks.

Simple, but computation-expensive, and probably not the best way:
Write your images in BufferedImageS and then simply add them (you’ll probably have to do that yourself by iterating through all points - I have now idea) and then draw your resulting image in JComponent.paintComponent(Graphics) - you’ll have to extend it.

Okay so there there a quicker way? Or would display a series of images be quicker?