I have a 30x30 GridLayout of JPanels. So each Cell in the 30x30 Frame is a JPanel with an Image. Aka Tiles on a map.
I need to move my character (red JPanel) around this map on keyPress.
How can I do this? I do not see a way of replacing a component in the GridLayout :S
Also, is there a better way than replacing the component because if I replace it, I'd have to keep track of the old component so that when the character moves to the next tile, it replaces the old component where the character used to be.