为图形填充渐变色: Graphics2D g2=(Graphics2D)g; GradientPaint gra=new GradientPaint(20, 20, Color.BLUE, 100,80,Color.cyan,true); g2.setPaint(gra); g2.fillRect(50, 50, 150, 150); 平移坐标轴: g2.translate(10,100); 创建椭圆对象: Ellipse2D.Float ellipse=new Ellipse2D.Float(…