Click here to Skip to main content
16,022,542 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dear friends i am doing a program that can display the some information using joptionpyne in java. but i don't know how to break the text to appear in more than one line
for example.
* product code: 1
* product: shoes
* unit price: 125.90
* discount: 5%
* total amount to be paid after discount: ------

i want something like this to appear
i tried........

JOptionPane.showMessageDialog(null,"..........................");
but i dont know how break it to appear in multiple line please help. THANKS!!!
Posted
Comments
ZurdoDev 4-May-13 22:53pm    
I don't know for sure in Java, but have you tried \r\n?
Shubhashish_Mandal 6-May-13 2:45am    
Yes, I agree with you, use "\n" to add new line .

maybe you even need to create a custom JDialog.

http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html[^]

That will guide you.
 
Share this answer
 
\n should do it. Sometime you'll need \r\n.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900