Java Reference
In-Depth Information
if (event.getSource() == delay)
{
//<Return> key pressed at end of entry into
//delay text fi eld, so reset delay…
int pause = Integer.parseInt(delay.getText());
sequence.setDelay(pause);
delay.setText("");
}
else
{
//<Return> key must have been pressed at end of
//entry into image name text fi eld, so change
//animation…
sequence.setImageName(imageName.getText());
imageName.setText("");
}
}
}
Figure 10.2 shows the resultant output.
Fig. 10.2 Modifi ed JavaBean
animation running in a GUI
10.5
Bound Properties
A bound property causes the owner of the property (i.e., the component whose
property it is) to notify other JavaBeans when the value of the property changes,
potentially leading to changes within those beans. The values changed in these other
Search WWH ::




Custom Search