Is it possible to perform active rendering in Java Swing without being on the EDT?

前端 未结 2 1085
生来不讨喜
生来不讨喜 2021-01-19 07:14

I am looking into using Buffer Strategy and the following technique described on the Javadoc:

// Main loop
while (!done) {
 // Prepare for rendering the next         


        
2条回答
  •  孤独总比滥情好
    2021-01-19 07:24

    As mentioned by trashdog it is not good idea to do so. Create own animation thread which will draw off-screen image. Then push it to some holder. If paintComponent is called fetch current image and draw it on component. Done. Look at rendezvous pattern.

提交回复
热议问题