// Set the font of the LabelField to be the same as that of the
// caller info displayed on the screen by the Phone application.
labelField.setFont(phoneScreen.getCallerInfoFont());
// Initialize a PhoneScreenHorizontalManager
final PhoneScreenHorizontalManager pshm =
new PhoneScreenHorizontalManager();
// Add the LabelField to the PhoneScreenHorizontalManager
pshm.add(labelField);
// Center the PhoneScreenHorizontalManager. UI fields
// are centered in the PhoneScreen by default with the
// exception of PhoneScreenHorizontalManager.
final int padPoint =
(phoneScreen.getDimensions().width - pshm.getPreferredWidth()) / 2;
if (padPoint > 0) {
pshm.setPadding(0, padPoint, 0, padPoint);
}
// Add the PhoneScreenHorizontalManager to the phone screen
phoneScreen.add(pshm);
}