import java.awt.*;

/** A CostSlider with a label centered above it. 
 *
 *  Taken from Core Web Programming from 
 *  Prentice Hall and Sun Microsystems Press,
 *  http://www.corewebprogramming.com/.
 *  &copy; 2001 Marty Hall and Larry Brown;
 *  may be freely used or adapted. 
 */

public class LabeledCostSlider extends Panel {
  public LabeledCostSlider(String labelString,
                           Font labelFont,
                           int minValue, int maxValue,
                           int initialValue,
                           Everest app) {
    setLayout(new BorderLayout());
    Label label = new Label(labelString, Label.CENTER);
    if (labelFont != null) {
      label.setFont(labelFont);
    }
    add(label, BorderLayout.NORTH);
    CostSlider slider = new CostSlider(minValue, 
                                       maxValue, 
                                       initialValue,
                                       app);
    add(slider, BorderLayout.CENTER);
  }
}  