Java Event Listener to detect a variable change

前端 未结 7 1719
逝去的感伤
逝去的感伤 2021-02-05 14:38

I cannot seem to find an answer anywhere to my question. Is there any event listener which can detect the changing of a boolean or other variable and then act on it. Or is it p

7条回答
  •  情深已故
    2021-02-05 15:25

    you create a listener when you want to listen for I/O changes. mostly on graphics. the answer to your question is to keep state of the running program, then check if variables change from the state inside the infinite loop of your program.

提交回复
热议问题