A class taht may be used for waiting e.g. for a event.
For example:
Observable obs;
final Waiter waiter = new Waiter();
final PropertyChangeListener pcl = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("..")) {
waiter.notifyFinished();
}
}
};
obs.addPropertyChangeListener(pcl);
// ...
waiter.waitFinished();
obs.removePropertyChangeListener(pcl);
author: ms113234 |