• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Other SWT Listeners

Chapter 14. Other SWT Listeners

In many of the examples so far you have seen that to respond to user events such as button clicking, you develop code using a listener. Until now, these listeners have been specific to the widget to which they were attached (i.e., attaching a SelectionListener to a button to respond to the click event). The SWT provides other Listener classes that are useful in making our user interfaces respond to other types of user actions. To understand event types, you must begin with the proposition that for every action a user can take in your application, an event will be generated by the operating system. This means that each time the user moves the mouse, or presses a mouse button or a key on the keyboard, an event, or multiple events, will occur.

Most of these events go unhandled by your application. After all, for most applications do you really need to know that the user moved the mouse from point A to point B within a window? Probably not. You need only know whether the user moved the mouse into a critical area or whether the user pressed a mouse button while pointing at a widget.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint