04-20-2013 08:47 AM - edited 04-20-2013 08:54 AM
This screenshot have three editfield i want to make this type of screen in blackberry. In editfield it should have # in starting and * at the end and it should not removed on back press key.
Solved! Go to Solution.
04-20-2013 10:11 AM
The easiest way to make this is have the entire Field as a HorizontalFieldManager. This will contain 3 Fields, a LabelField to display the "#", an EditField and another LabelField to display the *.
For the two LabelFields you will override paint() to set the color you want, then call super.paint().
The trick is the EditField, which by default will take all the space it is given. You need to restrict its width to leave space for the * at the end. The best way to do this is to override sublayout() in the HFM, and actually lay the Fields out yourself. Here are two KB articles that will help you do this:
There are other ways of doing this, but I believe this approach is the most flexible.