各位大侠帮我看看出了什么问题?
以下是我建立的一个五子棋的程序,但是运行时不能通过,提示如下错误信息:帮我看下怎么改过来啊,谢谢了
import java.awt.*;
import java.awt.Event.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.EventListener;
import java.util.Vector;
public class LoadPic extends Frame implements MouseListener
{
Vector v=new Vector();
public LoadPic()
{
super("五子棋棋盘");
this.addMouseListener(this);
this.setSize(435,465);
}
public void paint(Graphics g)
{
Toolkit toolkit =Toolkit.getDefaultToolkit();
Image img1=toolkit.getImage("blue.jpg");
Image imgwhite=toolkit.getImage("green.jpg");
g.drawImage(img1,0,20,this);
for(int i=0;i<v.size();i++)
{
String str=(String)v.get(i);
String tmp[]=str.split("-");
int a=Integer.parseInt(tmp[0]);
int b=Integer.parseInt(tmp[1]);
g.drawImage(imgwhite, a, b, this);
}
}
public static void main(String args[])
{
new LoadPic().show();
}
public void mouseCliked(MouseEvent e)
{
int x=e.getX();
int y=e.getY();
if(!v.contains(x+"-"+y))
{
v.add(x+"-"+y);
}
this.repaint();
}
public void mousePressed(MouseEvent e){}
public void mouseReleased(MouseEvent e){}
public void mouseEntered(MouseEvent e){}
public void mouseExited(MouseEvent e){}
}