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:

  1. pass controller object every view element, newly created actions use controller's methods modify rest of application.
  2. make controller static (for same reasons)
  3. 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

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -