// 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 InitialAmountField extends FormattedField { private CompoundingThread compThread; public InitialAmountField(double initialValue, CompoundingThread ct){ super(10, java.text.NumberFormat.getCurrencyInstance()); compThread = ct; Double value = new Double(initialValue); setValue(value); valueEntered(value); } public void valueEntered(Object value){ compThread.setInitialAmount(((Number) value).doubleValue()); } }