OO Programming in Java

Additional Material


Vending Machine View Helper Classes


The SCView classes included in the Exercise 3a Review (Zoo with a View) problem are sufficient to complete the Vending Machine GUI homework. For those of you who wish to explore or make it a little fancier I have included the TwoStateCanvas class and the ObserverLabel class.


The TwoStateCanvas starts its own thread and flashes an image.


The ObserverLabel is an Observer and displays the string passed to it from notifyAll(String)


Java Code