Friday, April 08, 2011

A Simple Observer

Today someone on StackOverflow asked about allowing 2 panels on a JFrame interact with each other. 

In order to answer the question I wrote a simple class to illustrate the concept of the Observer Pattern. Not the observer the way you would see it in a text book but the observer none the less. You can see the code on my website here.

For more details on design patterns check out Head First Design Patterns. It is a fantastic book.

And here is the answer that I posted on StackOverflow.