Computer Science Canada Graphics in Java |
Author: | np_123 [ Thu Oct 30, 2014 5:09 pm ] | ||
Post subject: | Graphics in Java | ||
Can graphics only be drawn from inside the paint() or paintComponent() method? Is there a difference between paint() and paintComponent()? For example, I have working code that draws a checkerboard. But if I want to go ahead and draw pieces on it, then move the pieces, how would I do that without redrawing the entire thing each time? because as far as i've been able to figure out, the only way to draw stuff is from the paint() method, and it draws everything in there all at once.
|