简体   繁体   中英

when clicked on a button how event is generated

I am complete fresher to java GUI.I read a statement in a book that "when we click on the button an event is generated".Is event a class , if yes then its object gets generated when we clicked on the button.Where this event object goes.?I think it first goes to the underlying OS.I am not sure please someone throw some light on it. Or please refer me a book which covers all these internal aspects.

Is event a class?

No, event is not class, it is interface. For example, by click on JButton , ActionListener interface is called and it execute abstract method of actionPerformed(ActionEvent e) for that button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM