Giving up control - Event-driven programming.
The GUI programming style is referred to as
event-driven programming. In this style of programming
you set up the graphical user interface and initialize things.
It appears that the program just stops and sits there doing nothing!
There is no input loop; your program isn't trying to read from the user.
You, the programmer, have to learn to give up control in two ways.
Your program gives control to the GUI system, and you only get control
back to when your listeners are called.
At an even higher level, your program has given control to the user.
It's the user who selects which of your methods to call by their choice
of buttons to click on, menu items to select, etc.
Listeners.
When the user clicks a button
(or uses another GUI component), an event is sent to listener method.
Your job as a programmer is to write a listener method for each
component.
It's the user, not the programmer, who has control, indirectly choosing methods in your program to execute
by interacting with graphical user interface components.
1More
Click on an Anonymous link, and you could be DDoS'ing the US government | Naked Security - 0 views
1More
Tackle stubborn disk partitioning in OS X - 0 views
1More
Howstuffworks "The Ultimate Internet Myths Quiz" - 0 views
1 - 13 of 13
Showing 20▼ items per page