posted 13 years ago
O Gur,
Please change your display name to conform to the JavaRanch naming policy, which you had agreed to when you signed up.
thanks.
Michael (the moderator)
Please change your display name to conform to the JavaRanch naming policy, which you had agreed to when you signed up.
thanks.
Michael (the moderator)
Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Ofer Gurman
Greenhorn
Posts: 6
posted 13 years ago
Hi Ofer,
There is no component or class that provides what you need in MIDP. I also had to do something like that. For the text-wrapping part I wrote a function that takes a string and divides it into lines based on the width available.
What you need is Canvas.getWidth() to see what is the maximum width of the screen and then Font.getCharWidth() to find out how many chars can you have in one line. you should also check for whitespace to break on word boundary.
There is no component or class that provides what you need in MIDP. I also had to do something like that. For the text-wrapping part I wrote a function that takes a string and divides it into lines based on the width available.
What you need is Canvas.getWidth() to see what is the maximum width of the screen and then Font.getCharWidth() to find out how many chars can you have in one line. you should also check for whitespace to break on word boundary.
Michael Yuan
author
Ranch Hand
Ranch Hand
Posts: 1427
posted 13 years ago
Ofer,
Your name still does not conform to the requirement. Please read the link I provided above. You need a first name and a last name.
In MIDP 2, the Choice.TEXT_WRAP_DEFAULT variable controls whether the item wraps text. There is no need for a custom item.
Your name still does not conform to the requirement. Please read the link I provided above. You need a first name and a last name.
In MIDP 2, the Choice.TEXT_WRAP_DEFAULT variable controls whether the item wraps text. There is no need for a custom item.
Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/

What's wrong? Where are you going? Stop! Read this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
|