urgent help in java Applet

Hello guys I need and urgent. Plz help me out
I want to capture the Screen as image and paint it on the applet .
I hav written code for it using Robot class . The code is compiling successfully but is giving runtime error as Nullpointer Exception . I m sending the code plz any one help me out to correct the code

/*<applet code="mage" width=600 height=600>

</applet>*/
import java.io.*;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.awt.image.*;

public class mage extends Applet
{

BufferedImage image;

Robot robot;

public void init(){
try
{
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screenSize = toolkit.getScreenSize();
Rectangle screenRect = new Rectangle(screenSize);
image=robot.createScreenCapture(screenRect);
}catch(Exception e){}
}
public void paint(Graphics g)
{

update(g);
}
public void update(Graphics g){
Graphics2D g2=(Graphics2D) g;
g2.drawImage(image,0,0,this);
}
}

I m eagerly waiting for reply
[1163 byte] By [colddol] at [2007-11-19 18:12:09]