FileDocCategorySizeDatePackage
TemperatureAdapter1.javaAPI DocExample729Tue Jun 03 22:45:16 BST 1997None

TemperatureAdapter1.java

// 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 TemperatureAdapter1 class

public class TemperatureAdapter1 extends TemperatureAdapter
{
   protected Thermometer target;

   // the constructor
   TemperatureAdapter1(Thermometer targ, Temperature t)
   {
      // pass this to the superclass
      super(t);
      
      target = targ;
   }

   public void tempChanged(TempChangedEvent evt)
   {
      target.temperature1Changed(evt.getTemperature());
   }
}