Я использую этот класс ::
public class JOChoiceField extends ObjectChoiceField {
int setWidth;
int setHeight;
public JOChoiceField (String text, Object[] choices, long setStyle, int initIndex, int pSetWidth, int pSetHeight) {
super(text, choices, initIndex, setStyle);
setWidth = pSetWidth;
setHeight = pSetHeight;
}
public int getPreferredWidth() {
return setWidth;
}
public int getPreferredHeight() {
return setHeight;
}
public void getFocusRect(XYRect rect) {
rect.set(getFont().getAdvance(getLabel()), 0, setWidth, setHeight);
}
protected void layout(int width, int height) {
int useWidth;
int useHeight;
useWidth = getPreferredWidth();
useHeight = getPreferredHeight();
setExtent(setWidth, setHeight);
super.layout(useWidth, useHeight);
}
};
MyCustomChoiceField= new JOCChoiceField("",MyArrayofItems,ObjectChoiceField.FIELD_LEFT|ObjectChoiceField.FOCUSABLE,0,100,50);
MyCustomChoiceField.setChangeListener(this);
MyCustomChoiceField.setFont(Font.getDefault().derive(Font.BOLD,6,2));
add(MyCustomChoiceField);