BlackBerry Application Development Guide monitors changes to UI objects (1)

Source: Internet
Author: User

UI EventListeners allows applications to respond to changes to a UI object. There are three types of UI event listeners:

Listen for field attribute changes

To monitor field changes, implement the FieldChangeListener interface. Call setChangeListener () to assign your implementation to a field.

 
 
  1. private class  
  2. FieldListener  implements implements implements  
  3. implements  
  4. FieldChangeListener  {  
  5. public void  
  6. fieldChanged(Field ,  int context)  {  
  7. if  
  8. (context  !=  FieldChangeListener.PROGRAMMATIC)  {  
  9. //  Perform  action  if  user  changed  field.  
  10. }  
  11. else {  
  12. //  Perform  action  if  application  changed  field.  
  13. }  
  14. }  
  15. }  
  16. //  ...  
  17. FieldListener  myFieldChangeListener  =  new  FieldListener()  
  18. myField.setChangeListener(myFieldChangeListener); 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.