level 6
lbj2004032
楼主
建文本 在SRC下
2-2-2
11111
10201
12021
10201
11111
3.3.3
3.3.3
11111
10201
12021
10201
11111
2-2-2
import java.awt.Graphics;
import java.awt.Image;
/**
* 棋子
*/
public class ChessBlock {
private String chessName;// 司令,工兵
private Image img;
private String color;
public String getChessName() {
return chessName;
}
public void setChessName(String chessName) {
this.chessName = chessName;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Image getImg() {
return img;
}
public void setImg(Image img) {
this.img = img;
}
public ChessBlock(String chessName, Image img, String color) {
super();
this.chessName = chessName;
this.img = img;
this.color = color;
}
//画图
public void draw(Graphics g){
g.drawImage(img, 0, 0, null);
g.drawString(chessName, 3, 10);
}
}
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.JPanel;
/**
* 棋盘
*/
public class ChessBoard extends JPanel {
private final static int WIDTH = 393;
private final static int HEIGHT = 532;
private JPanel panel = new JPanel();
private static ChessBox boxs[][] = new ChessBox[14][5];
public ChessBoard() {
this.setLayout(null);
this.setSize(WIDTH, HEIGHT);
this.setLocation(100, 0);
2010年02月26日 02点02分
1
2-2-2
11111
10201
12021
10201
11111
3.3.3
3.3.3
11111
10201
12021
10201
11111
2-2-2
import java.awt.Graphics;
import java.awt.Image;
/**
* 棋子
*/
public class ChessBlock {
private String chessName;// 司令,工兵
private Image img;
private String color;
public String getChessName() {
return chessName;
}
public void setChessName(String chessName) {
this.chessName = chessName;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Image getImg() {
return img;
}
public void setImg(Image img) {
this.img = img;
}
public ChessBlock(String chessName, Image img, String color) {
super();
this.chessName = chessName;
this.img = img;
this.color = color;
}
//画图
public void draw(Graphics g){
g.drawImage(img, 0, 0, null);
g.drawString(chessName, 3, 10);
}
}
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.JPanel;
/**
* 棋盘
*/
public class ChessBoard extends JPanel {
private final static int WIDTH = 393;
private final static int HEIGHT = 532;
private JPanel panel = new JPanel();
private static ChessBox boxs[][] = new ChessBox[14][5];
public ChessBoard() {
this.setLayout(null);
this.setSize(WIDTH, HEIGHT);
this.setLocation(100, 0);