“Buffers have not been created” … whilst creating buffers

后端 未结 2 1136
时光说笑
时光说笑 2021-01-19 01:33

I have (what I thought was) a straightforward BufferStrategy for a JFrame. It is created like so:

    // Buffer
    container.createBufferStrategy(2);                


        
2条回答
  •  旧巷少年郎
    2021-01-19 02:23

    Swing components are double buffered by default, so there is no need to play around with a BufferStrategy.

    However when you get random errors like that its usually because code is not executed on the EDT. Read the section from the Swing tutorial on Concurrency for more information.

提交回复
热议问题