I dont understand why or how but I am getting a nullpointerexception from this line of code:
public void drawFlag()
{
Graphics g = getGraphics();
g.drawImage(Ships.flag, mouseX, mouseY, null); // this is where I am getting pointed to by error. I have tryed changing the mouseX with 1 and mouseY with 1.
}
NOTE: the Ships.flag isn't the problem, I have a code almost identically to this that works:
public void drawShip(Graphics g)
{
g.draw(Ships.cruiser, x, y, null)
}

New Topic/Question
Reply



MultiQuote




|