JPanel in puzzle game not updating

前端 未结 3 1938
北恋
北恋 2020-11-22 11:24

I have a simple puzzle game. There is an image consisting of 16 tiles (randomly placed). Images are stored in an array and when game is launched they\'re added to main JPane

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 12:00

    After changing the components, you need to 'refresh' the Swing component by calling invalidate() or revalidate().

提交回复
热议问题