Swing Component Architecture

Back Up Next

 

Swing Component Architecture
Model-View-Controller (MVC) architecture
Model
Responsible for maintaining data and firing events to registered Views when the model changes
View
Responsible for providing a visual representation of some portion of the model's data
Controller
Handle events for the views
Swing actually uses a variation of the MVC architecture by combining the View and Controller into an UI Delegate that's responsible for handling events and drawing a visual representation of the Model
It is Swing's adoption of the MVC architecture that enables plaf to be easily implemented -- Models don't depend on Views or Controllers, so just plug a different View/Controller to a model to change the look and feel