Troubleshooting guide
20
BlackBerry Java Development Environment Development Guide
Define the preferred
height of a custom
component.
> Implement getPreferredHeight(), using the relative dimensions of the field label to determine the
preferred height.
public int getPreferredHeight() {
switch(_shape) {
case TRIANGLE:
if (_labelWidth < _labelHeight) {
return _labelHeight << 1;
} else {
return _labelWidth;
}
case RECTANGLE:
return _labelHeight + 4;
case OCTAGON:
return getPreferredWidth();
}
return 0;
}
Task Steps