public abstract class Graphics
extends Object
The Graphics class is the abstract base class for all graphics contexts that allow an application to draw onto components that are realized on various devices, as well as onto off-screen images. A Graphics object encapsulates state information needed for the basic rendering operations that Java supports. This state information includes the following properties:
The Component object on which to draw.
A translation origin for rendering and clipping coordinates.
The current clip.
The current color.
The current font.
The current logical pixel operation function (XOR or Paint).
The current XOR alternation color.
extends Object
The Graphics class is the abstract base class for all graphics contexts that allow an application to draw onto components that are realized on various devices, as well as onto off-screen images. A Graphics object encapsulates state information needed for the basic rendering operations that Java supports. This state information includes the following properties:
The Component object on which to draw.
A translation origin for rendering and clipping coordinates.
The current clip.
The current color.
The current font.
The current logical pixel operation function (XOR or Paint).
The current XOR alternation color.
//将原点改到原坐标系中的(x,y)点
canvas.update(g);
//canvas是Canvas类型的;如果你用的是Canvas的paint()方法的话
repaint是java.awt.Component及其子类的方法
你的这种情况需要知道更详细的信息才能判断是什么原因
http://java.sun.com/products/jfc/tsc/articles/painting/index.html