final Toolbar toolbar = new Toolbar();
f.setToolBar(toolbar);
final Container titleComponent = new Container(new BorderLayout());
final String titleText = contactToShow.getFirstName().toUpperCase().charAt(0) + ". " + contactToShow.getSurname();
final Label titleLabel = new Label(titleText);
titleLabel.setUIID("Title");
final String counterText = String.valueOf(contactAdapter.getContactIndex(contactToShow) + 1)
+ "/" + String.valueOf(contactAdapter.getContactCount());
titleComponent.addComponent(BorderLayout.CENTER, titleLabel);
titleComponent.addComponent(BorderLayout.EAST, new Label(counterText));
toolbar.setTitleComponent(titleComponent);
final Command backCommand = new Command("Contacts") {
@Override
public void actionPerformed(ActionEvent evt) {
back();
}
};
toolbar.addCommandToLeftBar(backCommand);