previous | start | next

The controller: 3

Lines 13 - 27 of the RectangleComponentViewer class create a listener to control mouse press events on the RectangleComponent.

Lines 29 - 30 create a listener of this class and add this listener to the RectangleComponent.

So the model (RectangleComponent) is primarily the data, but through inheritance from JComponent it can be connected to views and controllers:



previous | start | next