Back to notes -- Keyboard shortcut: 'u'              Lecture 13 - slide 23 : 30
Program 1
 

class ColorListener implements ActionListener, AdjustmentListener {
  // Listens to events from components of a ColorPresenter

  private ColorPresenter presentation;
  private INColor currentColor;

  public ColorListener (ColorPresenter presentation){
    this.presentation = presentation;
  }

  public void actionPerformed(ActionEvent action){
    presentation.adjust();
  }

  public void adjustmentValueChanged (AdjustmentEvent adjustment){
    presentation.sliderAdjust((Scrollbar)adjustment.getAdjustable(), 
                              adjustment.getValue());
  }
} // end class ColorListener