Respond to a scroll action

  1. Import the following classes:
    • net.rim.device.api.ui.TouchEvent
    • net.rim.device.api.ui.TouchGesture
    • net.rim.device.api.ui.Field
    • net.rim.device.api.ui.Manager
    • net.rim.device.api.ui.Screen
  2. Create a class that extends the Manager class.
     public class newManager extends Manager {
  3. In your implementation of the touchEvent(TouchEvent message) method, check if the value TouchEvent.getEvent() returns is equal to TouchEvent.MOVE.
    protected boolean touchEvent(TouchEvent message) {
       switch(message.getEvent()) {
          case TouchEvent.MOVE:
          return true;
       }
       return false;
    }

Was this information helpful? Send us your comments.