\t and \n in a String variable does not display in JOptionPane.showMessageDialog

kirthibv

New Member
In was wondering of there is any solution to my problem. I am trying to accumulate a String in a variable but the tab and new line does not take effect.Here is my code:\[code\]String message = "";for(int i=1; i<=5; i++){ message += i +"\t";}JOptionPane.showMessageDialog(null, message);\[/code\]It only displays:\[code\]1 2 3 4 5 \[/code\]instead of having tabs between the numbers
 
Top