I am writing a program with a rather complicated Swing interface. I am trying to apply the MVVM pattern for this. I was told that it was stupid to use it in Swing, such as WPF, there you go, but I decided to try it. It turns out something like this: in each ActionListener, I call the backbind () method, then some method on the ViewModel, then bind (). The problem occurs when the action in one View should affect the other View.

You can make a ViewModel with shared data singleton. And in the listener that affects several View do backbind () in this global ViewModel. And call her method. Backbind is data transfer from View to ViewModel

But how to make so several View would make bind? That is, they took the data from the ViewModel after it did something to them.

The ActionListener that caused this action affecting several View is in the same View. And from it I cannot call the bind () methods of other View in any way

    0