Java Reference
In-Depth Information
}
}
public void actionPerformed(ActionEvent event)
{
repaint();
}
public String getImageName()
{
return imageName;
}
public void setImageName(String name)
{
String oldName = imageName;
imageName = name;
changeSupport.fi rePropertyChange(
"imageName", oldName, imageName);
}
public int getDelay()
{
return delay;
}
public void setDelay(int delayIn)
{
delay = delayIn;
animTimer.setDelay(delay);
}
public Dimension getPreferredSize()
{
return new Dimension(140,120);
}
public void addPropertyChangeListener(
PropertyChangeListener listener)
{
changeSupport.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(
PropertyChangeListener listener)
{
changeSupport.removePropertyChangeListener(
listener);
}
}
It is a relatively simple matter to modify example AnimBeanApp2 from the previous
section to make use of the above bean, which is what the next example does.
Search WWH ::




Custom Search