import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class WritingText extends Applet {
String msg="";
int x=10,y=20;
public void init()
{
addKeyListener(new KeyAdpt());
requestFocus();
}
private class KeyAdpt extends KeyAdapter
{
public void keyTyped(KeyEvent e)
{
msg+=e.getKeyChar();
repaint();
}
}
public void paint(Graphics g)
{
g.drawString(msg,x,y);
}
}