Re: how to draw sth on a Panel permanently?



On Feb 21, 9:27 am, "Sowen Zhang" <sowenche...@xxxxxxxxx> wrote:
....
I need to draw sth to a Panel in an action, for instance

Graphics g = palCanvas.getGraphics();

This is the wrong way to approach
custom painting. It hould be done
on the Graphics object supplied to
paint()/paintComponent().

See,
<http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html>
for further details.

Andrew T.

.