public class AnimatedCellIcon
extends java.lang.Object
implements javax.swing.Icon
A wrapper for use in cases such as JTree and JTable where the method of rendering mean that animated gifs just don't work properly. This code relies on the icon being passed in to be either a ImageIcon, most likely an animated gif, or a custom implementation of Icon that implements Observable so as to allow nice custom animation steps.
The classic example of this is showing a busy icon when expanding a tree icon to indicate lazy loading. Also for showing busy icons inside of Tables.
Code original derrived from the following blog posting: http://rabbit-hole.blogspot.com/2006/09/animated-icon-redux.html
This code was moved from oracle.javatools.controls on 10-Dec-09
Constructor and Description |
---|
AnimatedCellIcon(javax.swing.Icon icon) |
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight() |
int |
getIconWidth() |
void |
paintIcon(java.awt.Component component,
java.awt.Graphics g,
int x,
int y) |
void |
repaint() |
public void paintIcon(java.awt.Component component, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public void repaint()
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon