Illegal State Exception when creating new Bufferstrategy

前端 未结 3 672
陌清茗
陌清茗 2020-12-03 22:35

When I am trying to figure out how to use bufferstrategies, and overall just improving how I write my code and cleaning things up. When I run the following code, I get an er

3条回答
  •  佛祖请我去吃肉
    2020-12-03 23:20

    In my experience with this error and with the code you writing you missing a frame function.

    Add where your frames are (ex: frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);) and add the function frame.add(game);

    In this example, mine is Display game = new Display(); but depending on what your variable for the new display is, it might vary.

提交回复
热议问题