Java MIDlet API Forums

« Back to Technical Discussion

Button text not centered vertically

Combination View Flat View Tree View
I'm creating simple buttons on the 7926 as follows:
 
StringItem button= new StringItem( null, "Button", StringItem.BUTTON );
 
The text is centered horizontally, but not vertically.  Instead, it is vertically aligned to the bottom of the button.  I've tried the following, all to no avail:
 
button.setLayout( StringItem.LAYOUT_CENTER );
button.setLayout( StringItem.LAYOUT_VCENTER );
button.setLayout( StringItem.LAYOUT_CENTER | StringItem.LAYOUT_VCENTER );
 
The text is centered properly, by default, in the 7926 simulator.
 
Suggestions?

 Go

By API/SDK: