Separating Form from Function
[ Home ] [ Up ] [ What are Events? ] [ The Java Event Model ] [ Buttons ] [ Pluggable Look & Feel ] [ Windows ] [ Mousing ] [ Keyboard Input ] [ Menus ] [ Separating Form from Function ] [ Event Multicasting ]

 

Actions

 

There are many cases in GUI-based applications where you want to accomplish the same function in more than one way.  For example, it is common to allow the user to select a piece of functionality by:

  • Selecting a menu item, or by 
  • Clicking on a toolbar icon, or by 
  • Clicking the mouse in a particular way, or by 
  • Typing some character sequence on the keyboard.

In other word, we wish to separate the form (how we expect the user to specify a function) from the actual implementation of that function.

For this reason, it is desirable in most non-trivial GUI programs to separate the GUI-specific interactions from the code that implements the action requested. 

 

This page was last modified on 02 October, 2007