// This file contains excerpts from the textbook Concrete // Abstractions: An Introduction to Computer Science Using Scheme, by // Max Hailperin, Barbara Kaiser, and Karl Knight, Copyright (c) 1998 // by the authors. Full text is available for free at // http://www.gustavus.edu/+max/concrete-abstractions.html public class InterestRateField extends FormattedField { public InterestRateField(double initialValue, CompoundingThread ct){ super(6, java.text.NumberFormat.getPercentInstance()); compThread = ct; Double value = new Double(initialValue); setValue(value); valueEntered(value); } private CompoundingThread compThread; public void valueEntered(Object value){ compThread.setInterestRate(((Number) value).doubleValue()); } }