public void draw( Graphics g) {
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/08/19 16:17:30
public void draw( Graphics g) {
Graphics2D g2d = (Graphics2D) g;
final int x = getX();
final int y = getY();
g2d.setColor( Color.GREEN );
g2d.setPaint( new GradientPaint( x,y,Color.GREEN,x + RADIUS/4,y + RADIUS/4,Color.BLACK,true) );
int xOffset = 0;
int yOffset = 0;
for( int i = 0; i < DENSITY; i++) {
xOffset = (int) (Math.random()*RADIUS);
yOffset = (int) (Math.random()*RADIUS);
g2d.draw( new Ellipse2D.Double( x + xOffset,y + yOffset,x + xOffset+3,y + yOffset+3) );
}
}
Graphics2D g2d = (Graphics2D) g;
final int x = getX();
final int y = getY();
g2d.setColor( Color.GREEN );
g2d.setPaint( new GradientPaint( x,y,Color.GREEN,x + RADIUS/4,y + RADIUS/4,Color.BLACK,true) );
int xOffset = 0;
int yOffset = 0;
for( int i = 0; i < DENSITY; i++) {
xOffset = (int) (Math.random()*RADIUS);
yOffset = (int) (Math.random()*RADIUS);
g2d.draw( new Ellipse2D.Double( x + xOffset,y + yOffset,x + xOffset+3,y + yOffset+3) );
}
}
![public void draw( Graphics g) {](/uploads/image/z/15495161-41-1.jpg?t=public+void+draw%28+Graphics+g%29+%7B)
public void draw( Graphics g) {
Graphics2D g2d = (Graphics2D) g;//转化g的类型为Graphics2D
final int x = getX()//;取得x坐标
final int y = getY();//取得y坐标
g2d.setColor( Color.GREEN );//设置填充色green
g2d.setPaint( new GradientPaint( x, y, Color.GREEN, x + RADIUS/4, y + RADIUS/4, Color.BLACK, true) );//设置填充方式,从点x,y到点x + RADIUS/4, y + RADIUS/4的颜色渐变从green到black
int xOffset = 0;//初始化x轴偏移变量
int yOffset = 0;//初始化y轴偏移变量
for( int i = 0; i < DENSITY; i++) {循环
xOffset = (int) (Math.random()*RADIUS);
yOffset = (int) (Math.random()*RADIUS);
g2d.draw( new Ellipse2D.Double( x + xOffset, y + yOffset, x + xOffset+3, y + yOffset+3) );//画一个椭圆
}
}
Graphics2D g2d = (Graphics2D) g;//转化g的类型为Graphics2D
final int x = getX()//;取得x坐标
final int y = getY();//取得y坐标
g2d.setColor( Color.GREEN );//设置填充色green
g2d.setPaint( new GradientPaint( x, y, Color.GREEN, x + RADIUS/4, y + RADIUS/4, Color.BLACK, true) );//设置填充方式,从点x,y到点x + RADIUS/4, y + RADIUS/4的颜色渐变从green到black
int xOffset = 0;//初始化x轴偏移变量
int yOffset = 0;//初始化y轴偏移变量
for( int i = 0; i < DENSITY; i++) {循环
xOffset = (int) (Math.random()*RADIUS);
yOffset = (int) (Math.random()*RADIUS);
g2d.draw( new Ellipse2D.Double( x + xOffset, y + yOffset, x + xOffset+3, y + yOffset+3) );//画一个椭圆
}
}
#include class A { public:void print1() { cout
public static void main(String[] args) {
public class SystemTest { public static void main(String[] a
public class Foo { public static void main(String[] args) {
public class Test { public static void main(String[] agrs) {
public class Test{ public static void main(String args[]){ i
public class TreeMapDemo { public static void main(String[]
java 九九乘法表public class s99{public static void main(String[]
public class StaticTest { public static int i=4; public void
AL的意思public class RalationOperator {\x09public static void m
class Dice{ public void get(){System.out.println("哈哈");}} cl
c++矩阵的加法 #include#includeclass matrix{public:void setvalue()