theEllipse = new Ellipse2D.Double( -1.0*ds,-0.25*ds,2.0*ds,0.5*ds); g2.setPaint(new GradientPaint( -1.0f*ds,0.0f*ds,Color.red, 1.0f*ds,0.0f*ds,Color.green)); //Red to green is not transparent g2.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER,1.0f)); g2.fill(theEllipse); Figure 5 |