object choice field in blackberry
I want to make an ObjectChoice field have fixed length. But by default ObjectChoice length is based on the content length.
For example if the content is "Choice 1", "Choice Choice Choice 1", the ObjectChoice field takes a different length depending on the 开发者_如何学Pythonselected choice.
Use this sample/example:
String choices[] = {"0","1","2","3","4"};
ObjectChoiceField choice1 = new ObjectChoiceField("", choices, ""){
public void layout(int width, int height){
width = 80;
super.layout(getWidth(), getHeight());
super.layout(width, height);
setExtent(width, super.getHeight());
}
};
精彩评论