I understand that when you add/remove a component, you need to revalidate() and then repaint(). However, I am changing the state of my polygon. Initial
revalidate()
repaint()
Call repaint(); after ter.moveR();moveL() in your listener.
repaint();
ter.moveR();moveL()
Additionally I would recommentd to use KeyBindings rather than KeyListener
KeyListener