views:

1739

answers:

3

how can i insert a newline character in a java applet program if i am using "label" instead of sys.out.println??

thanks in advance

+1  A: 

Put a \n in the string.

Like this:

String twoLineString = "first line\nsecond line";
Ben Alpert
+3  A: 

JLabel?

If you're using JLabel, you can use basic HTML in it

Try the following:

<html>Text<br>more text</html>

See this other answer

And upvote it too ;)

OscarRyz
+1  A: 

I am not sure what you are asking for but you can use System.getProperty("line.separator"); to get the line separator for your operating system.

David Billskog