Memory Game - Feeding an image array to a grid button matrix

前端 未结 1 1835
Happy的楠姐
Happy的楠姐 2021-01-24 12:24

I have my buttons created from my Design View in Netbeans (of type JToggleButton)

ex. btn00, btn01 ...

I have one matrix for my grid (Memory game style):

相关标签:
1条回答
  • 2021-01-24 13:23

    Note that a memory game doesn't need to know that the cells are arranged in a rectangular matrix; it only cares if two cells have matching images. This example uses two instances of List<GameButton>

    • buttons holds all of the memory cells.
    • selected records the current selection(s).
    0 讨论(0)
提交回复
热议问题