阅读背景:

如何为我的程序单击每个按钮的索引?

来源:互联网 

So I have a double array of buttons. Once I clicked a button I need to be able to get the index of it to use for further coding(This is a minesweeper like game). This is my code so far. I have a double for loop to create a Handle event for each button but i can't figure out how to get the indexes of each button. I've tried e.getSource() but it only returns the address which would be useless. I've tried give each button a Id but it only accepts strings. I'm lost on what to do next.So I have a double array of buttons. Once I cli




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: