public class LoadingIcon
extends java.lang.Object
implements javax.swing.Icon, java.awt.event.ActionListener
Modifier and Type | Class and Description |
---|---|
static class |
LoadingIcon.Unsafe
This class is a subclass of LoadingIcon that uses a (shared) java.util.Timer, and issues repaintImmediately
commands to the parent component on non-EDT thread.
|
Constructor and Description |
---|
LoadingIcon()
Creates a new loading icon with a default delay of 50ms between frames (initially stopped)
|
LoadingIcon(int delay)
Creates a new loading icon (initially stopped)
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
int |
getIconHeight() |
int |
getIconWidth() |
protected void |
initTimer(int delay) |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics graphics,
int x,
int y) |
protected void |
repaintParent() |
void |
start()
Start the animation
|
void |
stop()
Stop the animation
|
public LoadingIcon()
public LoadingIcon(int delay)
delay
- The delay between animation framesprotected void initTimer(int delay)
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public void start()
public void stop()
public void paintIcon(java.awt.Component c, java.awt.Graphics graphics, int x, int y)
paintIcon
in interface javax.swing.Icon
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
protected void repaintParent()