Files in the sample application

PictureScrollFieldDemo.java

This file defines the PictureScrollFieldDemo class.

The PictureScrollFieldDemo class extends the UiApplication class to support a UI and contains the following constructor and methods:

  • main(String[] args): provides the entry point to the sample application and starts the main thread for the application using the enterEventDispatcher() method from UiApplication
  • PictureScrollFieldDemo(): constructs a new PictureScrollFieldDemo object and creates a PictureScrollFieldDemoScreen object and displays it

PictureScrollFieldDemoScreen.java

This file defines the PictureScrollFieldDemoScreen class.

The PictureScrollFieldDemoScreen class extends the MainScreen class to support screen characteristics that are common to standard BlackBerry® device applications, implements the FieldChangeListener interface to support the handling of field change events, and contains the following constructor and methods:

  • PictureScrollFieldDemoScreen(): constructs a new PictureScrollFieldDemoScreen object, and contains the code that initializes an array of scroll entries, a PictureScrollField object, a choice field for selecting a highlight style, and a check box for turning the center lens on and off
  • onSavePrompt(): overrides the MainScreen.onSavePrompt() method with the functionality to suppress the dialog box that prompts the BlackBerry device user to save, because the sample application does not store persistent data
  • navigationClick(int status, int time): overrides the Screen.navigationClick(int status, int time) method with the functionality to make a dialog box appear if a click event occurs on an entry in the PictureScrollField
  • touchEvent(TouchEvent message): overrides the Screen.touchEvent() method with the functionality to make a dialog box appear when a TouchEvent.CLICK event occurs on an entry in the PictureScrollField object
  • fieldChanged(Field field, int context): overrides the FieldChangeListener.fieldChanged(Field field, int context) method to be notified of a change in the screen's highlight style ChoiceField, and change the highlight style of the screen's PictureScrollField object accordingly

Resource files

File name

Description

img/berry.jpg

img/building.jpg

img/logo_black.jpg

img/logo_blue.jpg

These files are the images that the PictureScrollField object displays on the screen.

img/icon_jde.png

This file is the application icon for the sample application.

TouchDemo.jdp

This file is the project file for the sample application.

Next topic: System requirements
Previous topic: Featured classes

Was this information helpful? Send us your comments.