10-17-2008 06:44 PM
How to set the custom color for each row in the ListField. how to obtain the fixed font / fixed screen size in all device.
how to set the Text Color of the Each Row in the List Field . I dont want the demo of the colored background listbox .
Tellme how to achive the above give me the alternate ways if not possible give the ur own suggestion.
10-17-2008 07:23 PM
You can override the paint() method in any field and set the foreground (text) color.
Then you will either draw the text yourself or call super().
See the API docs for Field (paint(), drawFocus()) and Graphics.
10-17-2008 07:46 PM - edited 10-18-2008 05:45 AM
Not sure what you mean by your questions but here are some thoughts:
"How to set the custom color for each row" - what in each row is colored. It seems that you don't want the background colored so I presume you mean you want the text colored, in which case it is just graphics.setColor(...);
"how to obtain the fixed font " - there is not, as far as I know, a non proportional font on the device. To set the font, it is graphics.setFont(...)
"fixed screen size in all device" - isn't this a contradiction? How can you have a fixed screen size when devices have differently sized screens? Sorry I don't understand this. Do you think it is possible to have something look the same on the Bold's 320 * 480 and the Curve's 240 * 320 and the Pearl's 240 * 320?
"set the Text Color " - is this the same as above "custom color for each row"?
"Tellme how to achive the above give me the alternate ways if not possible give the ur own suggestion"
In my opinion, the question you ask is too open-ended to get a good response. It is like asking "tell me how to get to Mumbai and give me alternate ways" - you can't answer that question without finding out where you are coming from. So my suggestion to you is to research what you want and try some alternatives, look at the samples to see what they do, then tell us what you have tried and ask for help. Yes, it is more work for you, but you will understand the answers that you are given, and perhaps you may learn enough to contribute to this forum. After all, this forum would not work if we just took ideas and didn't contribute.