Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage Return in Resource Bundle

Status
Not open for further replies.

tjkun

Programmer
Jan 23, 2002
15
TH
I'm using ResourceBundle in Java. I'd like to use carriage return in my properties file. However, it is skipped all the time.

Is there anyway I can force it not to skip carriage return

here's the list I have tried

\n, \r\n

Thanks
 
tjkun said:
However, it is skipped all the time

Can you be more specific? In what circumstance is it skipped? How about you post the code you're using, along with a snippet of the ResourceBundle properties file in question?

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
Code snippet:

private void buildDisplay(ResourceBundle resource){
...
...
iDescLb = new JLabel(resource.getString("description"));
...
..

Properties files:
...
...
description = This is the program ... (a very long description)...

When the resource get this long string, it just messes my application. I'd like to be able to display multiple line of description. I was trying to put \n with hope to have a new line..no luck.

Any helps, thanks.

 
What about a "\n" or System.getPropery("line.separator")?

Cheers,

Dian
 
I have put \n into the description. it doesn't work. How can I put System.getProperty("line.separator") into the properties files?
 
Your looking at the resource contents by using a JLabel which does not support multiline text and therefore won't honour your newlines.

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
I see. So what do you suggest then?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top