// This example is from the book Developing Java Beans by Robert Englander.
// Copyright (c) 1997 O'Reilly & Associates.
// You may study, use, modify, and distribute this example for any purpose.
// This example is provided WITHOUT WARRANTY either expressed or implied.
// Chapter 3 -- The TemperatureAdapter class
package BeansBook.Simulator;
public class TemperatureAdapter implements TempChangeListener
{
// the constructor
public TemperatureAdapter(Temperature t)
{
// register for events
t.addTempChangeListener(this);
}
// handle the event
public void tempChanged(TempChangedEvent evt)
{
// forward the event
}
}
|