Why does my jFrame update only after I resize the window?

后端 未结 1 1633
独厮守ぢ
独厮守ぢ 2021-01-22 10:41

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

相关标签:
1条回答
  • 2021-01-22 10:58

    Call repaint(); after ter.moveR();moveL() in your listener.

    Additionally I would recommentd to use KeyBindings rather than KeyListener

    0 讨论(0)
提交回复
热议问题