Sorry I gave you alot of irrelevant code. ^_^;
I added in the relevant part to yours.
//////////////////////////code/////////////(...)
import java.applet.*;
import java.awt.*;
public class Jump1 extends Applet implements Runnable
{
String jump1="\n\n\nabcd";/*actually I'd made two stickman figures in jump1 and jump2
but then deleted them cuz they were looking absurd without /n*/
String jump2="H\ne\nl\nl\no"; //this was originally "Hello" I just wanted to show you the \n
working
String msg;
boolean sign;
Thread t=null;
public void init()
{
setBackground(Color.blue);
setForeground(Color.white);
Font f=new Font("Courier",Font.BOLD,15);
setFont(f);
}
public void start()
{
t=new Thread(this);
sign=true;
t.start();
}
public void run()
{
boolean flag=false;
while(sign) {
if(flag){msg=jump2;}
else {msg= jump1;}
flag=!flag;
repaint();
try
{
Thread.sleep(1000); //this is milliseconds by the way. It was originally 100 and that was too fast for me ^_^;
}
catch(InterruptedException e)
{}
}
}
public void stop()
{sign=false; t=null;
}
public void paint(Graphics g)
{
String text = msg; //new line
int startX = 10; //new line
int startY = 10; //new line
for (String line : text.split("\n")) { //this splits the string into smaller strings starting with \n //new
line
g.drawString(line, startX, startY += g.getFontMetrics().getHeight()); //and then prints each string //new line
} //the height of the font gets added to startY each time to make the text print on a new line //new line
//g.drawString(msg,10,10); //you don't need this anymore so I commented it out
}
}
//////////////////////////end//////////////(...)
hope this helps ^_^