freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java掃雷游戲課程設(shè)計實訓(xùn)報告(doc畢業(yè)設(shè)計論文)-展示頁

2025-07-03 18:36本頁面
  

【正文】 for(int i = 0 。 i (int)(BlockNum) 。 bombButton=new Bomb[ (int)(BlockNum) ][]。 (MenuPamel,North)。 (start)。 (setBomb)。 (null,您設(shè)置的地雷數(shù)太多了,請重設(shè)!,錯誤,2)。 BombNum 50 ) replay()。 if(BombNum = 10 amp。 setBomb= new Label(設(shè)置地雷數(shù))。 text=new JTextField(10 ,3)。 ()。 BombNum = 10。 /*界面設(shè)計*/ public MainBomb() { super(成型042 李超 JAVA課程設(shè)計 )。 public Panel mainPanel = new Panel()。 //疑惑是否有雷 public JButton start = new JButton( 開始 )。 //踩雷標(biāo)記 public Icon icon_flag = new ImageIcon()。 //當(dāng)前方塊數(shù)當(dāng)前雷數(shù) public Icon icon_bomb = new ImageIcon()。 public Label nowBomb,setBomb。 import .*。 }}2.挖雷游戲 MainBomb(1)成員變量(見表4)表4成員變量描述變量類型名稱雷數(shù)設(shè)置JTextFieldtext當(dāng)前方塊數(shù)intBlockNum當(dāng)前雷數(shù)intBombNum開始JButtonstart踩雷Iconicon_bomb踩雷標(biāo)記Iconicon_bomb_big雷標(biāo)記Iconicon_flag疑惑是否有雷Iconicon_question目錄面板PanelMenuPamel主面板PanelmainPanel雷Bomb[][]bombButton該方塊是否有雷boolean周圍無雷方塊周圍的雷數(shù)int周圍的雷數(shù)方塊上的雷標(biāo)記int探雷標(biāo)記顯示方塊信息JLabelLabel方塊在雷區(qū)的位置PointP布雷RandomSetset判斷標(biāo)記是否正確DetermineDetermine是否獲得勝利WinnerWin雷標(biāo)數(shù)目intcount周圍方塊的雷數(shù)intcount1(2)方法見(表5)表5 方法名功能備注Game創(chuàng)建程序窗口barnewGame新開局actionPerformed處理ActionEvent事件接口方法設(shè)置方塊是否有雷設(shè)置雷的值設(shè)置是雷時的圖標(biāo)設(shè)置label上的圖標(biāo)設(shè)置無雷時的圖標(biāo)設(shè)置label上的圖標(biāo)設(shè)置有雷時的名字設(shè)置label上的文字設(shè)置周圍的雷數(shù)設(shè)置周圍的雷數(shù)獲取名字返回方塊label上的文字獲取周圍雷數(shù)返回周圍的雷數(shù)設(shè)置雷區(qū)位置設(shè)置屬性P獲取雷區(qū)位置返回屬性P獲取探雷標(biāo)記返回探雷標(biāo)記mousePressed處理鼠標(biāo)按下事件接口方法mouseClicked處理鼠標(biāo)雙擊事件接口方法mouseReleased處理鼠標(biāo)釋放事件接口方法mouseExited處理鼠標(biāo)退出事件接口方法mouseEntered處理鼠標(biāo)進(jìn)入事件接口方法MinesSquare創(chuàng)建雷區(qū)gameOver游戲失敗判斷雷標(biāo)是否正確正確返回true錯誤返回false布雷隨機(jī)布雷判斷是否成功成功返回true失敗返回false(3)import .*。 import .*。二、詳細(xì)設(shè)計1.主類Main(1)成員變量(見表2)表2 成員變量描述變量類型備注游戲運(yùn)行MainBomb臨時變量(2)成員變量(見表3)表3 名稱功能備注main游戲開始(3)import .*。:觸雷時方塊上的圖標(biāo)。:地雷方塊上的圖標(biāo)。2為主類創(chuàng)建整個挖雷游戲的對象,包括窗口,布雷,判斷等等。2.java源文件及其功能如表1所示。Java應(yīng)用技術(shù)實訓(xùn)報告一.總體設(shè)計本系統(tǒng)共包括3個java源文件和4個圖像文件。1.。表1 源文件及其功能序號文件名主要功能1生成的類負(fù)責(zé)創(chuàng)建程序窗口,含有main方法,游戲從該類開始執(zhí)行。3負(fù)責(zé)創(chuàng)建游戲所需要的按鈕。:疑惑探雷是否正確。:探雷標(biāo)記。 import .*。/*主類*/public class Main{ public static void main(String args[]) { (new MainBomb()).show()。 import .*。/*窗口及算法實現(xiàn)類*/class MainBomb extends JFrame implements ActionListener,MouseListener{ public JTextField text。 public int BlockNum,BombNum。 //踩雷 public Icon icon_bomb_big = new ImageIcon()。 //雷標(biāo)記 public Icon icon_question = new ImageIcon()。 public Panel MenuPamel = new Panel()。 public Bomb[][] bombButton。 BlockNum = 64。 Container c=getContentPane()。 (new BorderLayout())。 nowBomb = new Label(當(dāng)前雷數(shù)+ +BombNum+)。 (new ActionListener(){ public void actionPerformed(ActionEvent e) { BombNum = (().trim())。amp。 else { JOptionPane msg = new JOptionPane()。 } } } )。 (text)。 (nowBomb)。 (new GridLayout( (int)(BlockNum) , (int)(BlockNum)) )。 for(int i = 0 。 i++) { bombButton[ i ]=new Bomb[ (int)(BlockNum) ]。 i (int)(BlockNum) 。 j (int)(BlockNum) 。 bombButton[ i ][ j ].setForeground( )。 bombButton[ i ][ j ].addMouseListener(this)。 i (int)(BlockNum) 。 j (int)(BlockNum) 。 (mainPanel,Center)。 setSize(400,400)。 setResizable(false)。iBombNum。 int y =(int)(()*(int)((BlockNum)1))。
點擊復(fù)制文檔內(nèi)容
醫(yī)療健康相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1