Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 35
Registered: ‎02-11-2010
My Device: curve 8900
Accepted Solution

GUI - how to achieve



I would like to do following:


- 2 components (textfield, icon) in one row, icon placed right of textfield

- icon should move to the right when text is typed


Basically, it's something similar when trying to make call. Little green phone icon moves to the right while number is typed.


Does anyone know how to achieve this?

Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: GUI - how to achieve

there is no default component that has this behavior, but i would suggest to take a simple editfield and a bitmapfield and put them into either a simple custom layout manager or to overwrite getPreferredWidth on the editfield.

you change the width of the editfield (either in the layout or as the return value) when something is entered or deleted (use font.getadvance).

feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Posts: 35
Registered: ‎02-11-2010
My Device: curve 8900

Re: GUI - how to achieve

[ Edited ]

Thx Simon! Before asking on forum I did just what you said but had been unsuccessful. After you confirmed this is the right way I kept going and succeeded Smiley Happy