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

Chapter 5. SWT Text Fields > Reacting to Text Events

5.12. Reacting to Text Events

Sometimes the underlying business logic of your application requires that you respond to events that occur when the user interacts with a text field. One example is when you must perform validation on the field's contents before you enable the user to move away from the field to another widget on the window. Another example is the popular interface feature that causes text in a field to become selected whenever the field gains focus.

As with the MenuItem and ToolItem classes, for a text field to respond to an event a Listener must be added to the Text object. Text objects can respond to one of three text-specific listener types:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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