Skip to content
Search

Event driven architecture

lastmod 2021-04-20created 2015-06-182 edits

Most programs wait for the user's commands and run in response to the user's actions. Programming a program to respond to every user action, such as a mouse button click, double-click, or mouse movement, is called event-driven programming. In the Windows environment, most applications are written in the event-driven programming style.

Java's AWT also supports event-driven programming, of course. In Java, every user action is represented by a class called an event. An event object generated by a user action holds information about that action.

  • Event type information: e.g. mouse click, keyboard key press, etc.
  • Event target: e.g. the button the user clicked, the text field the user typed in, etc.
  • The time the event occurred
  • The X-Y coordinates where the event occurred: e.g. the position where the mouse was clicked, etc.
  • The keyboard key pressed: e.g. the key value of the key the user pressed
  • Arguments
  • State of modifier keys: e.g. Shift, Cntl, etc.

See also

Favorite site

author Zer0 sitemap