java.lang.IllegalStateException Exception, when creating bufferstrategy -
i'm trying develop own game engine, i've run java.lang.illegalstateexception
exception. when call graphic class main, should create buffer strategy , set java's graphics , on, it's not doing create buffer strategy part. instead it's giving me illegalstateexception.
here's code:
public class graphic extends canvas{ private graphics g; public graphic() { bufferstrategy bs = getbufferstrategy(); if(bs == null) { createbufferstrategy(3); return; } g = bs.getdrawgraphics(); g.drawstring("hello", 2, 2); g.dispose(); bs.show(); } }
Comments
Post a Comment