没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
/*
* 五子棋.java
*
* Created on 2006年10月24日, 上午8:12
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
/**
*
* @author 05040045
*/
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class 五子棋 extends Applet implements ActionListener,MouseListener
{
String str="谢立锋五子棋游戏!";
Dimension currentPos=new Dimension();
int zuobiao[][]=new int[19][15];
int x=20,y=20;
boolean unfirstpaint=false;
boolean one=false;
//======================================================================
public void init()
{
addMouseListener(this);
for(int i=0;i<=18;i++)
* 五子棋.java
*
* Created on 2006年10月24日, 上午8:12
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
/**
*
* @author 05040045
*/
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class 五子棋 extends Applet implements ActionListener,MouseListener
{
String str="谢立锋五子棋游戏!";
Dimension currentPos=new Dimension();
int zuobiao[][]=new int[19][15];
int x=20,y=20;
boolean unfirstpaint=false;
boolean one=false;
//======================================================================
public void init()
{
addMouseListener(this);
for(int i=0;i<=18;i++)
{
for(int j=0;j<=14;j++)
zuobiao[i][j]=0;
}
}
//======================================================================
public void paint(Graphics g)
{
int x0=30,y0=50,dx=30,dy=30,N=18,M=14;
int x1,y1,x2,y2;
g.setColor(Color.green);
y1=y0;
y2=y0+M*dy;
for(int i=0;i<=N;i++)
{
x1=x0+i*dx;
g.drawLine(x1,y1,x1,y2);
}
g.setColor(Color.red);
x1=x0;
x2=x0+N*dx;
for(int j=0;j<=M;j++)
{
y1=y0+j*dy;
g.drawLine(x1,y1,x2,y1);
}
g.setColor(Color.red);
g.setFont(new Font("TimesRoman",Font.BOLD,25));
g.drawString(str,120,30);
g.setColor(Color.red);
for(int j=0;j<=14;j++)
zuobiao[i][j]=0;
}
}
//======================================================================
public void paint(Graphics g)
{
int x0=30,y0=50,dx=30,dy=30,N=18,M=14;
int x1,y1,x2,y2;
g.setColor(Color.green);
y1=y0;
y2=y0+M*dy;
for(int i=0;i<=N;i++)
{
x1=x0+i*dx;
g.drawLine(x1,y1,x1,y2);
}
g.setColor(Color.red);
x1=x0;
x2=x0+N*dx;
for(int j=0;j<=M;j++)
{
y1=y0+j*dy;
g.drawLine(x1,y1,x2,y1);
}
g.setColor(Color.red);
g.setFont(new Font("TimesRoman",Font.BOLD,25));
g.drawString(str,120,30);
g.setColor(Color.red);
剩余7页未读,继续阅读
资源评论
- wluo1_112014-04-21简单,简洁,好用。谢谢
nymphenzhou
- 粉丝: 1
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功