Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (


Class AnimatedCellIcon

  extended by oracle.javatools.ui.AnimatedCellIcon
All Implemented Interfaces:
Direct Known Subclasses:

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:

This code was moved from oracle.javatools.controls on 10-Dec-09

Constructor Summary
AnimatedCellIcon(javax.swing.Icon icon)
Method Summary
 int getIconHeight()
 int getIconWidth()
 void paintIcon(java.awt.Component component, java.awt.Graphics g, int x, int y)
 void repaint()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public AnimatedCellIcon(javax.swing.Icon icon)
Method Detail


public void paintIcon(java.awt.Component component,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon


public void repaint()


public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon


public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (


Copyright © 1997, 2011, Oracle. All rights reserved.