I'm getting an error during the execution of the code.. even though der is no error while editing the code in eclipse..
I hav included the code for panel and main function.. and also screen class for making the game full screen..
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;
public class pro extends JPanel{




Missile missile;
Ship ship;
DisplayMode dm;
JFrame winframe;
int score=0,shield=10,shots=10;
Rock[] rocks;
boolean focusgained,focuslost;
int nofrocks;
Image[] fire;
Image bullet;
Image shipim;
Image rock;
Random rand;
Actionmain actionmain;
Actionrocks actionrocks;
Actionlaser actionlaser;
Timer timermain;
Timer timerlaser;
Timer timerrocks;
boolean ismisfired,isrockblast,isshipattack;

int winwidth,winheight;






public pro(){







timermain=new Timer(20,actionmain);
timerrocks=new Timer(10,actionrocks);
timerlaser =new Timer(20,actionlaser);
shipim=new ImageIcon("C:\\Users\\Dinesh_Raghavendra\\Desktop\ \images\\ship.gif").getImage();
fire[0]=new ImageIcon("C:\\Users\\Dinesh_Raghavendra\\Desktop\ \images\\boom0.gif").getImage();
fire[1]=new ImageIcon("C:\\Users\\Dinesh_Raghavendra\\Desktop\ \images\\boom1.gif").getImage();
fire[2]=new ImageIcon("C:\\Users\\Dinesh_Raghavendra\\Desktop\ \images\\boom2.gif").getImage();
fire[3]=new ImageIcon("C:\\Users\\Dinesh_Raghavendra\\Desktop\ \images\\boom3.gif").getImage();
fire[4]=new ImageIcon("C:\\Users\\Dinesh_Raghavendra\\Desktop\ \images\\boom4.gif").getImage();

addMouseListener(new MouseListener(){


public void mouseClicked(MouseEvent arg0) {


focusgained=true;

}


public void mouseEntered(MouseEvent arg0) {

}


public void mouseExited(MouseEvent arg0) {

}


public void mousePressed(MouseEvent arg0) {

}


public void mouseReleased(MouseEvent arg0) {

}





});
addFocusListener(new FocusListener(){


public void focusGained(FocusEvent f) {

focusgained=true;
timermain.start();
timerrocks.start();
repaint();
}


public void focusLost(FocusEvent f) {
if(timermain!=null&&timerrocks!=null){
timermain.stop();
timerrocks.stop();
}

focuslost=true;
repaint();


}


});
addKeyListener(new KeyListener(){


public void keyPressed(KeyEvent e) {
int keycode=e.getKeyCode();
if(keycode==KeyEvent.VK_UP){
ship.centery+=15;
}
else if(keycode==KeyEvent.VK_DOWN){
ship.centery-=15;
}
else if(keycode==KeyEvent.VK_LEFT){
ship.centerx-=15;
}
else if(keycode==KeyEvent.VK_RIGHT){
ship.centerx+=15;
}
else if(keycode==KeyEvent.VK_SPACE){
ismisfired=true;
}

}


public void keyReleased(KeyEvent e) {

}


public void keyTyped(KeyEvent e) {


}



});



}
public void draw1st(Graphics g){
g.setFont(new Font("Serif",Font.ITALIC,36));

g.drawString("Press Space to start the game",0,0);

}
public void drawnxt(Graphics g){

g.setFont(new Font("Serif",Font.ITALIC,36));
g.drawString("Shield: "+shield+"/10",0, getHeight()-10);
g.drawString("shots remaining: "+shots+"/10",0, getHeight()-25);
g.drawString("score: "+score,0, getHeight()-50);

}
public void drawstars(Graphics g){
Color c[] = null;
int i=0;

switch(i){
case 0: c[0]=Color.RED;
break;
case 1:c[1]=Color.CYAN;
break;
case 2:c[2]=Color.BLUE;
break;
case 3:c[3]=Color.GREEN;
break;
}
for(int j=0;j<40;j++){
int cx=rand.nextInt();
int cy=cx;
i=rand.nextInt(3);

g.setColor(c[i]);
g.fillOval(cx, cy, 1, 1);
}


}
public class Actionlaser implements ActionListener{

@Override
public void actionPerformed(ActionEvent ae) {
shots++;

}


}
public class Actionmain implements ActionListener{


public void actionPerformed(ActionEvent ex) {

ship.update();

for(int i=0;i<nofrocks;i++){
rocks[i].update();
}
if(ismisfired){

missile.update();
}

}
}

public class Actionrocks implements ActionListener{


public void actionPerformed(ActionEvent ex) {
nofrocks=rand.nextInt(7);
ship.update();
for(int i=0;i<nofrocks;i++){
rocks[i].update();
}
if(ismisfired){
missile.update();
}
}
}



public void paintComponent(Graphics g){

ship=new Ship();
rocks=new Rock[7];

missile=new Missile();

super.setBackground(Color.BLACK);
drawstars(g);
ship.draw(g);
if(isshipattack){
ship.drawhit(g);
}


for(int i=0;i<nofrocks;i++){
rocks[i].draw(g);
if(isrockblast){

rocks[i].drawblast(g);
}

}

if(ismisfired){
missile.draw(g);
}


if(focusgained){
drawnxt(g);
drawstars(g);
}
if(focuslost){
draw1st(g);
drawstars(g);
}



}

public class Ship{
int shipx,shipy,shipx1,shipy1;
long width;
int height;

int drawx,drawy;
int centerx,centery;
public Ship(){


width=shipim.getWidth(null);
height=shipim.getHeight(null);
shipx1=shipx+shipim.getWidth(null);
shipy1=shipy+shipim.getHeight(null);
shipx=300;

shipy=getHeight()-shipim.getHeight(null)-100;
centerx=(shipx+shipx1)/2;
centery=(shipy+shipy1)/2;
ismisfired=false;

isshipattack=false;

}
public void update(){
if((shipx1)>getWidth()){
shipx=getWidth()-centerx;

}
if(shipx<0){
shipx=0;
}
if(shipy<0){
shipy=0;
}
if(shipy1>getHeight()){
shipy1=getHeight();
}



}
public void draw(Graphics g){
g.drawImage(shipim,shipx,shipy,null);

}
public void drawhit(Graphics g){
g.drawImage(shipim,shipx,shipy,null);
g.drawOval(centerx, centery, (int) width, height);
}

}
public class Rock{
int rockx,rocky,rockx1,rocky1;
boolean isrockblast;
int centerx,centery;
Window win;


public Rock(){
rock=new ImageIcon("C:\\Users\\Dinesh_Raghavendra\\Desktop\ \images\\meteor.gif").getImage();

rockx=rand.nextInt(win.getWidth());
rocky=0-rock.getHeight(null);
centerx=(rockx+rockx1)/2;
centery=(rocky+rocky1)/2;
rockx1=rockx+rock.getWidth(null);
rocky1=rocky+rock.getHeight(null);
isrockblast=false;


}
public void update(){

if(centerx+ship.centerx<(rock.getWidth(null)+ship. width)/2&&centery+ship.centery<(rock.getHeight(null)+ship .height)/2)
{
isrockblast=true;
isshipattack=true;

}
rocky-=20;

}
public void draw(Graphics g){
g.drawImage(rock,rockx,rocky,null);

}
public void drawblast(Graphics g){
for(int i=0;i<5;i++){
g.drawImage(fire[i],rockx,rocky,null);
}

}

}

public class Missile{
int missx,missy,missx1,missy1;
int centerx,centery;
Window win;

public Missile(){
bullet=new ImageIcon("C:\\Users\\Dinesh_Raghavendra\\Desktop\ \images.bullet.gif").getImage();
centerx=ship.centerx;
centery=ship.centery;

missx=centerx-bullet.getWidth(null)/2;
missy=centery-bullet.getHeight(null)/2;

}
public void update(){
for(int i=0;i<7;i++){

if((centerx+rocks[i].centerx)<(bullet.getWidth(null)+rock.getWidth(nul l))/2&&(centery+rocks[i].centery)<(bullet.getHeight(null)+rock.getHeight(n ull))/2){
isrockblast=true;
ismisfired=false;
}

}

missy+=20;
}
public void draw(Graphics g){
g.drawImage(bullet,missx,missy,null);



}
}

}


//main function
import java.awt.DisplayMode;
import java.awt.Window;

import javax.swing.JFrame;
public class mainfunc {

public static void main(String args[]){

DisplayMode dm=new DisplayMode(1280,800,16,DisplayMode.REFRESH_RATE_U NKNOWN);
JFrame window = new JFrame("SpaceShip Game");
Window w = new JFrame();
screen s=new screen();






window.setContentPane(new pro());
s.fullscreen(dm, window);
w=s.getFullScreenWindow();







window.setSize(w.getWidth(),w.getHeight());
window.setLocation(00,00);
window.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
window.setResizable(false); // User can't change the window's size.
window.setVisible(true);







}





}

// screen class
import java.awt.*;
import javax.swing.JFrame;

public class screen {

static GraphicsDevice vc;
public screen(){
GraphicsEnvironment enc=GraphicsEnvironment.getLocalGraphicsEnvironmen t();

vc=enc.getDefaultScreenDevice();

}
public void fullscreen(DisplayMode dm,JFrame window){

window.setResizable(false);
window.setUndecorated(true);

vc.setFullScreenWindow(window);
if(dm!=null && vc.isDisplayChangeSupported()){
try{vc.setDisplayMode(dm);
}
catch(Exception ex){}


}
}
public static Window getFullScreenWindow(){


return vc.getFullScreenWindow();
}
public void restore(){


Window w=vc.getFullScreenWindow();
if(w!=null){
w.dispose();
}
vc.setFullScreenWindow(null);


}
}