I’ve moved over to use BufferStrategy from BufferedImage for my first attempt at a game (I’m using Java2D as a learning experience) and the performance boost is pretty noticeable. I’m constructing the game as an applet for the time being and it’s all working fine, but when running it from Netbeans/AppletViewer I get an ugly IllegalStateException showing up in the console when I close down the applet. Presumably that’s because I’m killing it mid-flow.
Is there any particular way I should be handling this? I could of course put the BufferStrategy code in a try block and handle the exception that way, but I just wanted to check if that was the right thing to do and/or if there is a better way of doing it?