Introduction to Java Interface Event-Handling

hen you program with event-driven languages, users typically see an interface containing controls, buttons, menus and other graphical elements. After displaying the interface, the program waits. What happens next depends almost entirely on the user.

Usually, that means users interact with the controls to make something happen. For example, a user may click a button, or choose a menu item. Whatever users choose to do, they will initiate an event, which in turn, fires code in an event-handler, which is a part of the program coded respond to the specific event. After handling the event, the program waits for the user to do something else.

With that in mind, event-driven interface programming becomes a matter of setting up an interface that responds to the user’s actions. The program becomes a collection of bursts of code that are modular in fashion and tied specifically to possible actions.

In contrast, linear-based procedural programs provide limited user options. The program retains the bulk of the control.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: