Results 1 to 3 of 3
  1. #1
    Dipke is offline Member
    Join Date
    Aug 2010
    Location
    Leuven, Belgium
    Posts
    86
    Rep Power
    0

    Default Little MVC question

    Hi,

    I have a MVC with a Model and different views.
    But not all the view has to be updated each change of the Model.
    How can let the controller now witch view to update with wich change?

    kind regards

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Dipke View Post
    I have a MVC with a Model and different views.
    But not all the view has to be updated each change of the Model.
    How can let the controller now witch view to update with wich change?
    Have your Model contain a ProperyChangeSupport member object. The model can fire different events on different occasions (read the API specification for the PropertyChangeSupport class). The different event listeners in the Controller update the different View objects according to which event was fired by the Model.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Dipke is offline Member
    Join Date
    Aug 2010
    Location
    Leuven, Belgium
    Posts
    86
    Rep Power
    0

Similar Threads

  1. Question concerning question marks and colons
    By jim01 in forum New To Java
    Replies: 17
    Last Post: 01-14-2011, 01:05 AM
  2. Question mark colon operator question
    By orchid in forum Advanced Java
    Replies: 9
    Last Post: 12-19-2010, 09:49 AM
  3. question
    By sunilgamidi in forum Introductions
    Replies: 0
    Last Post: 09-28-2010, 09:23 AM
  4. One question..
    By LuC2 in forum New To Java
    Replies: 3
    Last Post: 08-25-2009, 02:29 AM
  5. Need help on this question
    By Deon in forum New To Java
    Replies: 3
    Last Post: 01-27-2008, 04:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •