在你要绘的Component上调用getGraphics返回一个Graphics可以进行各种绘制。
但奇怪的Graphics中是没有画点的函数。用划线的代替把。
abstract void drawLine(int x1, int y1, int x2, int y2)
Draws a line, using the current color, between the points (x1, y1) and (x2, y2) in this graphics context's coordinate system. abstract void setColor(Color c)
Sets this graphics context's current color to the specified color.
但奇怪的Graphics中是没有画点的函数。用划线的代替把。
abstract void drawLine(int x1, int y1, int x2, int y2)
Draws a line, using the current color, between the points (x1, y1) and (x2, y2) in this graphics context's coordinate system. abstract void setColor(Color c)
Sets this graphics context's current color to the specified color.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货