Example
import javax.swing.event.*;
public class EventDemo extends Jframe {
JSlider width = new JSlider(JSlider.HORIZONTAL, 1, 450, 75);
JSlider height = new JSlider(JSlider.VERTICAL, 1, 450, 75);
Toolkit tk = Toolkit.getDefaultToolkit();
Icon icon = new DynamicIcon
(tk.getImage("goldenrod_motto_new.JPG"), width, height);
final JLabel dynamicLabel = new JLabel(icon);
/* anonymous inner class listener */
class Updater implements ChangeListener {
public void stateChanged(ChangeEvent ev) {