Welcome!

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

Reply
New Developer
Posts: 7
Registered: ‎02-01-2010
My Device: Storm
My Carrier: Fernando

Re: TextFields with Rounded Edges

Please post all code.....

Regards

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

Re: TextFields with Rounded Edges

we help users to help themselves. i guess if i would get money from RIM i would happily provide code here, i doubt my company would pay me for it though. Feel free to do it yourself, i can send you the code Smiley Happy

----------------------------------------------------------
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
New Developer
Posts: 137
Registered: ‎02-04-2010
My Device: Tour 9630
My Carrier: verizon

Re: TextFields with Rounded Edges

Excellent solution. thanks.

how can I set the left & right padding?

for example, I want the box to begin 50 pixels from the left.

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: TextFields with Rounded Edges

<field>.setPadding(top, right, bottom, left);

 

Not documented in earlier OS's but works.

New Developer
Posts: 16
Registered: ‎01-05-2011
My Device: Bold 9700
My Carrier: Digicel

Re: TextFields with Rounded Edges

THANK YOU!!!!!

 

I have searched for this for 8 months

Developer
Posts: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel

Re: TextFields with Rounded Edges

Try this one.....   EditField field=customEditField(0);

public static EditField CustomEditField(long style) {
		EditField field = new EditField(EditField.FIELD_VCENTER
				| EditField.USE_ALL_WIDTH | EditField.FIELD_RIGHT | style|EditField.NO_NEWLINE) {
			
			protected void paintBackground(Graphics g) {

				g.setColor(Color.WHITE);
				g.fillRect(0, 0, getWidth() - 5, getHeight() - 10);
				g.setColor(Color.SILVER);
				g.drawRect(0, 0, getWidth() - 5, getHeight() - 10);
				g.setColor(Color.BLACK);
				super.paintBackground(g);
			}

		};
		
		field.setPadding(5, 6, 10, 5);
		return field;
	}

 Hope it help you..

 

 

Thanks &regards

Yakub Pasha..

 

Developer
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630
My Carrier: MTN

Re: TextFields with Rounded Edges

Please the border factory s of which class , i used it in my eclipse and the ide can't recognize it .
New Developer
Posts: 137
Registered: ‎02-04-2010
My Device: Tour 9630
My Carrier: verizon

Re: TextFields with Rounded Edges

I think it is:

import net.rim.device.api.ui.decor.BorderFactory;

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

Re: TextFields with Rounded Edges

borderfactory is 4.6 or higher, check your target version
----------------------------------------------------------
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
Developer
Posts: 103
Registered: ‎12-12-2011
My Device: Developer
My Carrier: Robosoft

Re: TextFields with Rounded Edges

From where can I get the image which is used in the code? Let me know it please....