[Solved]AWTException createBufferStratergy

Hi guys,

I am a newbie to Java. I thought of making a small game with it. (When I mean small I actually mean it.) I am creating a bufferStrategy with the Window class. I just fixed the illegal state exception and now I have a new problem. When the line is executed it throws the AWTException.

Window w = new Window(frame);
		
		w.setVisible(true);
		try{
		w.createBufferStrategy(2);
		}catch (Exception e){
			System.out.println(e.getLocalizedMessage());
			System.out.println(e.getMessage());
		}
		bs = w.getBufferStrategy();

And I can’t continue. This error occurs only when I debug the application in Eclipse. Other wise a NullPointerException occurs. It is basically due to this.
So could some one help me?

Regards,
Abhi2011