Last active
June 19, 2020 19:50
-
-
Save sasssass/5564894a7c7b8f7e956fb4af28a2a147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Thermometer { | |
var support : PropertyChangeSupport = PropertyChangeSupport(this) | |
var temperature : Int = 0 | |
set(value) { | |
support.firePropertyChange("temperature", temperature, value); | |
field = value | |
} | |
fun addPropertyChangeListener(pcl: PropertyChangeListener?) { | |
support.addPropertyChangeListener(pcl) | |
} | |
fun removePropertyChangeListener(pcl: PropertyChangeListener?) { | |
support.removePropertyChangeListener(pcl) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment