Expanding and Centering ImageItems appearing as Buttons

Hi,

I am developing a midlet for school which has a Form as main menu. I've added StringItems appearing as Buttons to this menu and I want them to fill the complete screen so I used the LAYOUT.EXPAND. No problems so far, everything works but I want the my button's label to be centered as well. I've tried everything and searched everywhere but nothing works. My current source;

roosterVandaag =new StringItem("Rooster vandaag", null, Item.BUTTON);

datumKiezen =new StringItem("Datum kiezen", null, Item.BUTTON);

settings =new StringItem("Opties", null, Item.BUTTON);

roosterDownloaden =new StringItem("Rooster Downloaden", null, Item.BUTTON);

afsluiten =new StringItem("Afsluiten", null, Item.BUTTON);

//Set de layout voor de StringItems

roosterVandaag.setLayout(Item.LAYOUT_EXPAND);

datumKiezen.setLayout(Item.LAYOUT_EXPAND);

settings.setLayout(Item.LAYOUT_EXPAND);

roosterDownloaden.setLayout(Item.LAYOUT_EXPAND);

afsluiten.setLayout(Item.LAYOUT_EXPAND);

Now I need to center the text which appears in the Expanded Button..please help me, I'm desperate because this is for school!!

[1500 byte] By [AmsterdamStudenta] at [2007-11-27 4:07:32]
# 1
Hi, Have you triedsetLayout(Item.LAYOUT_EXPAND | Item.LAYOUT_CENTER);Hope that help, Jack
jack@square6a at 2007-7-12 9:12:51 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Hi,

Problems regarding the layout of items on the screen is a common problem in MIDP when developing for a specific target device.

Where did you encounter those problems? You didn't mention it, but does your solution -- including the correct hint from jack -- work as expected on the Wireless Toolkit simulator? I know that there are some devices out there that have a different implementation regarding the layouting of items...

Cheers,

Jasper

jappersa at 2007-7-12 9:12:51 > top of Java-index,Java Mobility Forums,Java ME Technologies...