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: 62
Registered: ‎01-19-2010
My Device: storm
My Carrier: storm

what is new line character in java application

Hi,

 

I wants to use multiline labelfield I have read in forum that "\n " character is use for nextline.but its not working in my application.

 

So please suggest me someting.

 

 

Developer
Posts: 36
Registered: ‎11-19-2008
My Device: Blackberry 9000 - Bold

Re: what is new line character in java application

[ Edited ]

"\n" is what I usually use.  Perhaps you can post some of your sample code that doesn't work?

Chirashi Security
New Contributor
Posts: 6
Registered: ‎02-20-2010
My Device: Curve 8330
My Carrier: Sprint

Re: what is new line character in java application

This may be simple, but use the character single quotes, not the string double quotes... '\n' not "\n"

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

Re: what is new line character in java application

[ Edited ]

LabelField support for new line seems to vary by OS level.  I can't remember exactly and will test if you want, but from memory, in 4.5 and below, the new line character is ignored.  In other words, if you want a multiple line LabelField, you have to do it as a RichTextField in 4.5 or before.  Not a a major problem, just a bit of pain because a LabelField respects its width and a RichTextField always grabs the full width, so is more difficult to put in a HorizontalFieldManager or a FlowFieldManager. 

 

Anyway, the important point here is what OS level are you testing on?