JAVA程序解释 谁能帮我翻译一下这段程序代码的意思,每句话分别解释

importjava.util.*;importjava.io.*;importjava.awt.*;importjava.awt.event.*;importjava.... import java.util.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
class Gobang extends JFrame implements Runnable, ActionListener
{
final static int Player=1;
final static int AI =-1;
ClassLoader cl = this.getClass().getClassLoader();
Toolkit tk = Toolkit.getDefaultToolkit();
int length=14, game_state, winner, check, step;
int grid[][] = new int[length][length];
int locX, locY /* 下棋位置 */, count /* 连棋数 */, x, y /* 暂存位置 */, displace_x=0, displace_y=0 /* 位移量 */, direction;
ArrayList steps = new ArrayList();/* 记录棋步 */
JPopupMenu control_menu = new JPopupMenu();/* 右键选单功能 */
JMenuItem[] command = new JMenuItem[4];
String[] command_str={"悔棋", "存档", "读档", "重开"};
int[][] dir = { {-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1} };
boolean[] dir2 = new boolean[8];
boolean turn;
String message;
final JDialog dialog = new JDialog(this, "请选子", true);
Font font=new Font("new_font", Font.BOLD, 20);
Grid grids[][] = new Grid[length][length];
Image white= tk.getImage(cl.getResource("res/white.png"));
Image black= tk.getImage(cl.getResource("res/black.png"));
Image title= tk.getImage(cl.getResource("res/title.png"));
Image temp;
JPanel boardPanel, bigpanel;
JRadioButton[] choice = new JRadioButton[2];
final static int Start =0;
final static int Select =1;
final static int Playing =2;
final static int End =3;
final static int nil=-1; /* 无方向 */
final static int oblique_1 =0; /* 右上向左下 */
final static int oblique_2 =1; /* 左上向右下 */
final static int horizontal =2; /* 横向 */
final static int vertical=3; /* 直向 */
Gobang()
{
super("五子棋");
boardPanel = new JPanel();
boardPanel.setLayout(new GridLayout(length, length, 0, 0));
boardPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
for(int i=0; i<length; i++)
for(int j=0; j<length; j++)
{
grids[i][j] = new Grid(i, j);
boardPanel.add(grids[i][j]);
}
bigpanel = new JPanel();
bigpanel.add(boardPanel, BorderLayout.CENTER);
getContentPane().add(bigpanel, BorderLayout.SOUTH);
game_state=Start;
ThreadStart();
dialog.setSize(160, 100);
dialog.setResizable(false);
dialog.setLocationRelativeTo(null);
ButtonGroup choice_group = new ButtonGroup();
JPanel choice_menu = new JPanel();
choice[0] = new JRadioButton("黑子", new ImageIcon(black), true);
choice[1] = new JRadioButton("白子", new ImageIcon(white));
展开
 我来答
大时代暑
2011-05-22 · TA获得超过2.5万个赞
知道大有可为答主
回答量:4111
采纳率:0%
帮助的人:4809万
展开全部
没人帮你解释的,学习主要靠自己!
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式