Anonymous
Anonymous asked in 電腦與網際網路程式設計 · 1 decade ago

有幾段java程式幫解說或註解

1. gameMenu.setMnemonic('G');

2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

3.newConnectionItem.addActionListener(new ItemHandler());

4.aboutItem.addActionListener(new ItemHandler());

5.arrowIcon[0] = new ImageIcon("icon/upArrow.gif");

6.meLabel = new JLabel(meIcon);

7.eatPanel.setLayout(new GridLayout(2, 8));

8.for(int i = 0; i < pieceIcon1.length; i++)

pieceIcon1[i] = new ImageIcon(pieceIconPath1[i]);

9.Character me = new Character(this);

Update:

3QQ~~

http://tw.knowledge.yahoo.com/question/question?qi...

這個網址也請大大幫忙摟

1 Answer

Rating
  • 1 decade ago
    Favorite Answer

    gameMenu.setMnemonic('G');//將gameMenu的助憶符號設為'G'

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//設定一按關閉鍵就離開程式

    newConnectionItem.addActionListener(new ItemHandler());//替newConnectionItem加入事件處理功能

    aboutItem.addActionListener(new ItemHandler());//替aboutItem加入事件處理功能

    arrowIcon[0] = new ImageIcon("icon/upArrow.gif");//實體化arrowIcon[0]物件,並參考icon/upArrow.gif圖檔

    meLabel = new JLabel(meIcon);//建立meLabel物件,並設定meIcon做為圖示

    eatPanel.setLayout(new GridLayout(2, 8));//設定eatPanel面版為2*8格的版面配置方式

    for(int i = 0; i < pieceIcon1.length; i++ )

    pieceIcon1[i] = new ImageIcon(pieceIconPath1[i]);//搭配pieceIconPath1字串陣列,並利用迴圈一一實體化pieceIcon陣列內的物件

    Character me = new Character(this);//建立Character型態之物件me,並傳入類別本身做為建構子參數

    Source(s): Mx
Still have questions? Get your answers by asking now.