Hey guys.
this thing is the this will work:

public void mouseReleased(MouseEvent evt) {
Graphics g = getGraphics();
g.drawLine(...);
}

but this wont:

Graphics g = getGraphics();
public void mouseReleased(MouseEvent evt) {
g.drawLine(...);
}


the question is why?
it is the same with the paint methode too, the graphics has to be created inside? why wont the outside work?

thanks.