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
Developer
Posts: 174
Registered: ‎08-20-2008
My Device: Not Specified
Accepted Solution

New line in TextField

Hi All What is the easiest way to do a carriage return or new line in a TextField? I have tried \n and \\n but both print as is. \\\n works but leaves a trailing back slash and \\\\n just prints as is.
Developer
Posts: 174
Registered: ‎08-20-2008
My Device: Not Specified

Re: New line in TextField

\\r\\n doesn't seem to work either
Highlighted
Developer
Posts: 174
Registered: ‎08-20-2008
My Device: Not Specified

Re: New line in TextField

Ah, single quotes work but not speech marks (strange to me as that is the opposite to php). '\n' did the trick in the end.
Developer
Posts: 77
Registered: ‎06-03-2009
My Device: Not Specified

Re: New line in TextField

+ '\r' + '\n' worked for me
Contributor
Posts: 34
Registered: ‎03-14-2010
My Device: N/A
My Carrier: Fledge

Re: New line in TextField

Sorry for bringing back an old post... but to clarify:

 

'\n' represents 1 character (a carriage return) whereas "\n" represents a string - 2 characters - not a carriage return.