// 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 TemperatureAdapter2 class
public class TemperatureAdapter2 extends TemperatureAdapter
{
protected Thermometer target;
// the constructor
TemperatureAdapter2(Thermometer targ, Temperature t)
{
// pass this to the superclass
super(t);
target = targ;
}
public void tempChanged(TempChangedEvent evt)
{
target.temperature2Changed(evt.getTemperature());
}
}
|