求java大神帮忙!!!!

importjavax.swing.*;importjava.awt.*;publicclasschessextendsJFrame{JButtonabc=newJBut... import javax.swing.*;
import java.awt.*;
public class chess extends JFrame{
JButton abc=new JButton();
public int j;
public ImageIcon soldier1image=new ImageIcon("soldier1.jpg");
public ImageIcon soldier2image=new ImageIcon("soldier2.jpg");
public ImageIcon master1image=new ImageIcon("master1.jpg");
public ImageIcon master2image=new ImageIcon("master2.jpg");
public ImageIcon toxotae1image=new ImageIcon("toxotae1.jpg");
public ImageIcon toxotae2image=new ImageIcon("toxotae2.jpg");
public chess(){
setLayout(new GridLayout(8,8,5,5));
JButton[] button=new JButton[64];
for (int i=0;i<=63;i++){
button[i]=new JButton();
add(button[i]);
button[i].addActionListener(new Actionlistener(){
public void actionPerformed(ActionEvent e){abc=(JButton)e.getSource;}}); }
button[0].setIcon(soldier1image);
button[7].setIcon(soldier2image);
button[24].setIcon(master1image);
button[31].setIcon(master2image);
button[56].setIcon(toxotae1image);
button[63].setIcon(toxotae2image);
soldier soldier1=new soldier(1);soldier1.setplace(0);
soldier soldier2=new soldier(2);soldier1.setplace(7);
master master1=new master(1);master1.setplace(24);
master master2=new master(2);master1.setplace(31);
toxotae toxotae1=new toxotae(1);toxotae1.setplace(56);
toxotae toxotae2=new toxotae(2);toxotae1.setplace(63);
commonproperty [] common=new commonproperty[6];
common[0]=soldier1;common[1]=soldier2;common[2]=master1;common[3]=master2;common[4]=toxotae1;common[5]=toxotae2;
for(int i=0;i<=63;i++)if(abc==button[i]){j=i;break;}
for(int i=0;i<=5;i++)
{if(j==common[i].getplace)break;}
move(common[j].getplace);
for(int k=0;k<=5;k++){if(j!=k&&common[j].getplace==common[k].getplace)fight(common[j],common[k]);}
for(int m=0;m<=5;m++){
if(common[m].getplace!=-1)
{if(m==0)button[common[m].getplace()].setIcon(soldier1image);
if(m==1)button[common[m].getplace()].setIcon(soldier2image);
if(m==2)button[common[m].getplace()].setIcon(master1image);
if(m==3)button[common[m].getplace()].setIcon(master2image);
if(m==4)button[common[m].getplace()].setIcon(toxotae1image);
if(m==5)button[common[m].getplace()].setIcon(toxotae2image);
}}
int s=0;
for(int h=0;h<=5;h++){if(common[h].getplayer()!=0)s++;}
if(s==1){for(int g=0;g<=5;g++){if(common[g].getplayer()!=0)result(common[g]);}}

}
展开
 我来答
养初厹06
2012-06-13 · TA获得超过203个赞
知道小有建树答主
回答量:784
采纳率:0%
帮助的人:415万
展开全部
你要编写的么?你求的是什么啊?出错了还是要代码
追问
帮我改程序,我正在改,很多错误。。。。。。。。
追答
来一段错误代码,要么麻烦
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式