/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ /* ein erweitertes Label * als event listener fuer * das eigene Ereignis */ import java.awt.Label; import java.awt.Color; public class ViewLabel extends Label implements CounterChangedListener { public ViewLabel() { super(); setAlignment(Label.CENTER); setBackground(Color.gray); } public void counterChanged(CounterChangedEvent e) { setText(Integer.toString(e.cnt)); } }