I have a data model model which has a boolean flag connected, and I have a view with several components that I want to enable if model.isConnected() is true and disable if it is not. What is the best way to implement this?
I have a data model model which has a boolean flag connected , and
Share
Have your model accept PropertyChangeListeners (perhaps by delegating to a PropertyChangeSupport). Fire a PropertyChangeEvent whenever the
connectedstate changes. Have the components listen to that property change, and change their visual state as appropriate.