Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Create tabbed view screens

by Retired ‎02-16-2010 12:12 PM - edited ‎09-16-2010 03:47 PM (7,076 Views)

Summary

 

This article applies to BlackBerry® devices based on Java®.

 


Description

 

This article covers the creation of a screen with several labels, or tabs, across the top of the screen. These tabs are selected by scrolling, which controls the display of fields on the screen below the set of tabs.

 

The basic approach is to use a set of Managers to control the sets of Fields that appear on the Screen when a tab has been selected. Tabs are implemented as focusable LabelFields, with a FocusChangeListener doing the Manager switch when focus changes. Fields and Managers are initialized once and maintained in memory to retain state changes between tabs.

 

A HorizontalFieldManager contains the tabs at the top of the screen, with simple non-focusable separators between, and a SeparatorField below. Below this is a VerticalFieldManager initialized to the first tab view. The LabelFields have a focus listener set on them. When the listener's focusChanged() method is fired, the main VerticalFieldManager is removed from the screen, set to the VerticalFieldManager associated with the tab that now has focus, and then added back to the screen.

 

Review this java code sample for details.

Users Online
Currently online: 48 members 6,307 guests
Please welcome our newest community members: