}
public void resetPanel(Solution solution) {
removeAll();
repaint(); // When GridLayout doesn't fill up all the space
NQueens nQueens = (NQueens) solution;
int n = nQueens.getN();
List<Queen> queenList = nQueens.getQueenList();
setLayout(new GridLayout(n, n));
for (int row = 0; row < n; row++) {
for (int column = 0; column < n; column++) {
Queen queen = queenList.get(column);
if (queen.getColumn().getIndex() != column) {