Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use setLayout in Item class?

 
martin filton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to place a StringItem in the bottom of a form.
I try this:
mMessage = new StringItem(null, "");
mMessage.setLayout(Item.LAYOUT_BOTTOM);
But i get this from the compiler:
cannot resolve symbol variable LAYOUT_BOTTOM

Is there anyone who knows how to use this metode?

-Martin

[ November 29, 2004: Message edited by: martin filton ]
[ November 29, 2004: Message edited by: martin filton ]
 
Joel Karimpil
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
haven't tried it
but just try this
instead of Item.LAYOUT_BOTTOM
try StringItem.LAYOUT_BOTTOM
 
Tomas Conway
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method setLayout() and LAYOUT constants were added in MIDP 2.0. If you're compiling with MIDP 1.0 I would expect to get this error, but I would also expect to get an error because of the presence of the call to setLayout(), regardless of the parameters you pass to it.

Also you would get errors on setLayout() and LAYOUT_BOTTOM if those lines of code are outside a method (but within a class).
[ November 30, 2004: Message edited by: Tomas Conway ]
 
martin filton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some stringitems that I want to have on their own line:
STRINGITEM1
STRINGITEM2
STRINGITEM3

Here is what I try to do:


Is it posible to do somthing like this?

-Martin
 
martin filton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just added:
StringItem it = new StringItem(null, subskjerm+"\n",Item.BUTTON);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic