グリッドレイアウトの指定された場所に JButton を追加しようとしていますが、これを行う方法がわかりません。
public void addButtons()
{
myBoard = myController.getMyBoard();
for (int i = 0; i < this.getEntryInt(); i++)
{
for(int j = 0 ; j < this.getEntryInt(); j++)
{
if(myBoard[i][j]==true)
{
buttons[i][j] = new JButton("Q"); // error: The type of the expression must be an array type but it resolved to JButton
}
}
}
}
グリッド レイアウトの特定のプロットにボタンを追加する方法はありますか?