private void setBufferStrategy() {
        try {
            EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    myWindow.createBufferStrategy(2);    //NUM_BUFFERS);
                }
            });
        } catch(Exception e) {
            System.out.println("Error while creating BufferStrategy");
            System.exit(0);
        }
        
        try {
            thread.sleep(500);
        } catch(InterruptedException ex) {
            
        }
        
        bufferStrategy = myWindow.getBufferStrategy();
    }