swing - How to deal with events in Java MVC -
i'm creating first "bigger" application in java. mvc pattern know, decided use it. there's wrong concept.
for example. need action
(or event) fired 2 places (from button
in frame , menuitem
). has changes in @ least 2 places , in model.
i've got ideas, seem wrong:
- pass controller object every view element, newly created actions use controller's methods modify rest of application.
- make controller static (for same reasons)
- make controller model listener
please tell me how build it. or give me links easy analyse applications.
source of project here, if wants have look: https://github.com/arrvi/colorextractor
you correct use action
encapsulate functionality use disparate components such menus , buttons. spectrum of examples cited here. regards mvc, recall swing uses separable model architecture, examined here. in effect, user controller, , not every interaction needs pass through application's controller.
Comments
Post a Comment