国产偷录视频叫床高潮,国产精品久久久久久影视,国产乱理伦片a级在线观看,国产精品无码a∨精品影院,国产片av国语在线观看

五子棋棋盤(pán)java實(shí)現(xiàn)

其實(shí)我也有用JAVA做五子棋呢~,棋盤(pán)都是用畫(huà)的,我把代碼發(fā)下,你自己試下,也不定合你一意.事件代碼我都去啦,因?yàn)槭呛?jiǎn)單的麻煩事.~!

importjava.awt.*;

importjavax.swing.*;

@SuppressWarnings(serial)

publicclassChessBoardextendsJPanel{

/*

*制作棋盤(pán)的寬高;

*/

publicstaticfinalintBOARD_WIDTH=515;

/*

*計(jì)算棋盤(pán)表格坐標(biāo)(單元格寬高相等)

*/

publicstaticint[]location=newint[22];

static{

for(inti=0,WIDTH=30;i<location.length;i++,WIDTH+=22){

location[i]=WIDTH;

}

}

publicChessBoard(intx,inty){

super(null);

this.setBounds(x,y,BOARD_WIDTH,BOARD_WIDTH);

this.setBackground(newColor(255,164,85));

}

/**

*重寫(xiě)方法,繪制棋盤(pán)表格圖;

*/

publicvoidpaintComponent(Graphicsg){

super.paintComponent(g);

charch='A';

g.setFont(newFont(宋體,Font.BOLD,12));

//畫(huà)橫線

for(inti=0,width=30+22*21;i<location.length;i++,ch++){

g.setColor(Color.black);

g.drawLine(30,location[i],width,location[i]);

g.setColor(Color.blue);

g.drawString(+ch,5,location[i]+3);

}

//畫(huà)豎線

for(inti=0,width=30+22*21;i<location.length;i++){

g.setColor(Color.black);

g.drawLine(location[i],30,location[i],width);

g.setColor(Color.blue);

g.drawString(+(i+1),location[i]-3,13);

}

}

}

免責(zé)聲明:本站發(fā)布的游戲攻略(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng)。
如果本文侵犯了您的權(quán)益,請(qǐng)聯(lián)系站長(zhǎng)郵箱進(jìn)行舉報(bào)反饋,一經(jīng)查實(shí),我們將在第一時(shí)間處理,感謝您對(duì)本站的關(guān)注!