I am creating a game where each player fills a 3x3 grid and they all have a different state of the grid (a player object has an instance variable as the grid and the grid is made up of many `JPanel`s).

I have a `JList` of players on the left and on the right the grid is displayed. Is there a way to dynamically change the grid when I click on a player's name in the list?

(I tried doing a `for` loop to update the grid every time a player is selected but then if the player updates the grid after he is selected, it gets hacky to update the grid i.e you have to make the list get the focus etc. so I am looking for a clean way)

EDIT: Also, I thought about changing the reference of the object dynamically and update the UI however I have some action events which enforces me to make the variables FINAL. So I am unable to do this way either.