I have an array of JPanels that draws a Checkers-style board, some of those JPanels have black or yellow pieces on them, according to their position. I want to be able to move those pieces obviously.. is there a way to do that by switching their position in the array? I tried using the basic swap way in which I create a tmp and switch.. but that didn't work.. any help is much appreciated.
the swap trial:
JPanel tmp = board[4][3];
board[4][3] = board[2][7];
board[2][7] = tmp;