Is it possible to write your own objects that give out ActionEvents?

前端 未结 2 847
[愿得一人]
[愿得一人] 2020-12-21 18:29

I\'ve looked at the java tutorials online and they all seem concerned with catching ActionEvents given out by other components that are already written. Is it possible to wr

2条回答
  •  执念已碎
    2020-12-21 18:58

    Yes.

    I suggest you look at the java API documentation for ActionEvent and EventListenerList.

    I also suggest that you read about the Listener (also called Observer) pattern.

提交回复
热议问题