Is there a better practice for Listeners?

前端 未结 5 2030
深忆病人
深忆病人 2020-12-10 22:49

Say I have a swing GUI, and I want to listen MouseEvents. Who do you think should be the Listener class, who should be responsible? What is the best-or preferr

5条回答
  •  甜味超标
    2020-12-10 23:50

    I would suggest to put the listener in its own class, to make it re-usable, and to have a clear separation of concerns

提交回复
热议问题