homeduke Prof. Dr. Uwe Schmidt FH Wedel

Die Datei: ViewColor.java


weiter
   1/* ein rot gruen Label
   2 * als event listener fuer
   3 * das eigene Ereignis
   4 */
   5
   6import java.awt.Color;
   7
   8public
   9class ViewColor
  10  extends ViewLabel
  11{
  12
  13  public
  14  ViewColor() {
  15    super();
  16    setBackground(Color.green);
  17  }
  18
  19  public
  20  void counterChanged(CounterChangedEvent e) {
  21    setBackground( e.cnt > 1
  22                   ? Color.green
  23                   : e.cnt < -1
  24                   ? Color.red
  25                   : Color.yellow );
  26  }
  27}

Die Quelle: ViewColor.java


Letzte Änderung: 09.06.2008
© Prof. Dr. Uwe Schmidt
Prof. Dr. Uwe Schmidt FH Wedel