运行效果如下图所示:源代码如下(可以直接运行出结果):import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.util.*;import java.io.*;//主类public class Chess{public static void main(String args[]){new ChessMainFrame("中国象棋,博大精深");}}//主框架类class ChessMainFrame extends JFrame implements ActionListener,MouseListener,Runnable{//玩家JLabel play[] = new JLabel[32];//棋盘JLabel image;//窗格Container con;//工具栏JToolBar jmain;//重新开始JButton anew;//悔棋JButton repent;//退出JButton exit;//当前信息JLabel text;//保存当前操作Vector Var;//规则类对象(使于调用方法)ChessRule rule;/**** 单击棋子** chessManClick = true 闪耀棋子 并给线程响应** chessManClick = false 吃棋子 停止闪耀 并给线程响应*/boolean chessManClick;/**** 控制玩家走棋** chessPlayClick=1 黑棋走棋** chessPlayClick=2 红棋走棋 默认红棋** chessPlayClick=3 双方都不能走棋*/int chessPlayClick=2;//控制棋子闪耀的线程Thread tmain;//把第一次的单击棋子给线程响应static int Man,i;ChessMainFrame(){new ChessMainFrame("中国象棋");}/**** 构造函数** 初始化图形用户界面*/ChessMainFrame(String Title){//获行客格引用con = this.getContentPane();con.setLayout(null);//实例化规则类rule = new ChessRule();Var = new Vector();//创建工具栏jmain = new JToolBar();text = new JLabel("欢迎使用象棋对弈系统");//当鼠标放上显示信息text.setToolTipText("信息提示");anew = new JButton(" 新 游 戏 ");anew.setToolTipText("重新开始新的一局");exit = new JButton(" 退 出 ");exit.setToolTipText("退出象棋程序程序");repent = new JButton(" 悔 棋 ");repent.setToolTipText("返回到上次走棋的位置");//把组件添加到工具栏jmain.setLayout(new GridLayout(0,4));jmain.add(anew);jmain.add(repent);jmain.add(exit);jmain.add(text);jmain.setBounds(0,0,558,30);con.add(jmain);//添加棋子标签drawChessMan();//注册按扭监听anew.addActionListener(this);repent.addActionListener(this);exit.addActionListener(this);//注册棋子移动监听for (int i=0;i<32;i++){con.add(play[i]);pl...