文档介绍:课程设计
--------蜘蛛纸牌
―――――――――――――――――――――――――――――――――――――――
目录
课程设计 1
--------蜘蛛纸牌 1
目录 1
2
3
11
21
――――――――――――――――――――――――――――――――――――――-
效果截图:
源程序代码:
import .*;
import .*;
/*
**“关于”窗口
*/
public class AboutDialog extends JDialog {
JPanel jMainPane = new JPanel();
JTabbedPane jTabbedPane = new JTabbedPane();
private JPanel jPanel1 = new JPanel();
private JPanel jPanel2 = new JPanel();
private JTextArea jt1 = new JTextArea(
"将电脑多次分发给你的牌按照相同的花色由大至小排列起来。直到桌面上的牌全都消失。");
private JTextArea jt2 = new JTextArea(
"该游戏中,纸牌的图片来自于Windows XP的纸牌游戏,图片权属于原作者所有!");
/*
* *构造函数
*/
public AboutDialog() {
setTitle("蜘蛛牌");
setSize(300, 200);
setResizable(false);
setDefaultCloseOperation();
Container c = ();
(260, 200);
(260, 200);
(false);
(false);
(true);
(true);
(new Font("楷体_GB2312", , 13));
();
(new Font("楷体_GB2312", , 13));
();
(jt1);
(jt2);
(300, 200);
("游戏规则", null, jPanel1, null);
("声明", null, jPanel2, null);
(jTabbedPane);
(jMainPane);
pack();
(true);
}
}
import .*;
import .*;
import .*;
public class PKCard extends JLabel implements MouseListener,
MouseMotionListener {
// 纸牌的位置
Point point = null;
Point initPoint = null;
int value = 0;
int type = 0;
String name = null;
Container pane = null;
Spider main = null;
boolean canMove = false;
boolean isFront = false;
PKCard previousCard = null;
public void mouseClicked(MouseEvent arg0) {
}
public void flashCard(PKCard ca