GUI threading in java

后端 未结 3 1386
天命终不由人
天命终不由人 2020-12-22 08:34

I\'m trying to code a simple game in Java. The basic structure is a single JFrame with different JPanels that I add/remove at different times. At s

3条回答
  •  攒了一身酷
    2020-12-22 09:23

    The layout and painting must be done in EDT. Use SwingUtilities.invokeAndWait to call the validate() and repaint()

提交回复
热议问题