Search code examples
javastaticpropertychangelistener

Get PropertyChangeListener notification on static variables (class variables)


In my code I need to know when a specific static variables change is value. I know that in Java I can register myself as listener for the instance variables but I can' t do that with the static (class) variables. Can anyone have workaround for this problem? Thanks


Solution

  • You can always wrap your static variable with static accessors and add code in those accessors.