views:

379

answers:

1

Hi All,

I want to add a new LabelField(String label, long style) but if I use Field.FIELD_HCENTER as my style then I get the following alignment.

|---- This text is horizontally aligned but in ----|
|---- a block.

But what I want is;

|---- This text is horizontally aligned and ----|
|------- independently so for each line --------|

Is this simple to achieve? I can't find the field constant to get this to work for me.

Thanks in advance,

Gav

+1  A: 

Try DrawStyle.HCENTER

alt text

class Scr extends MainScreen {
    String mText = "Lorem ipsum dolor sit amet, "
      + "consectetur adipiscing elit. Sed adipiscing "
      + "dui quis velit placerat vulputate.";
    LabelField mLabel = new LabelField(mText, DrawStyle.HCENTER);

    public Scr() {
     add(mLabel);
    }
}
Max Gontar
Fantastic, thanks.
gav
You're welcome!
Max Gontar