【柯哀王道】左右两边的世界-作者:忧冷繁星
JAVA期末课题实践考察--五子棋游戏设计
import java.awt.Color;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.ButtonGroup;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
/*
*main方法创建了ChessFrame类的一个实例对象(cf),
*并启动屏幕显示显示该实例对象。
**/
public class FiveChessAppletDemo {
public static void main(String args[]){
ChessFrame cf = new ChessFrame();
cf.setVisible(true);
}
}
/*
*类ChessFrame主要功能是创建五子棋游戏主窗体和菜单
**/
class ChessFrame extends JFrame implements ActionListener {
/**
*
*/
private static final long serialVersionUID = 2183726320279905885L; private String[] strsize={"20x15","30x20","40x30"};
private String[] strmode={"人机对弈","人人对弈"};
public static boolean iscomputer=true;