What does ActionEvent e mean?

前端 未结 3 1462
走了就别回头了
走了就别回头了 2021-01-13 20:30

I am learning Java and would really like to have a deeper understanding of what the ActionEvent e perameter means and stands for. When I code I don\'t just want to spit out

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-13 20:58

    The ActionEvent is an "event" that your listener catches, as sent by a dispatcher. This mean, in layman's terms, that some thread somewhere has decided that your actions (i.e. clicking a button, etc.) have caused an action to occur, and informs the System. Your listener picks up on this, and takes a reference as the parameter e. This may help to shed a bit more light on what/why the action is; and, it may be beneficial to check out the Event Dispatch Thread (EDT).

提交回复
热议问题