Try this
Code:
package asd;
import javax.swing.JFrame;
import java.awt.*;
import java.awt.geom.*;
@SuppressWarnings("serial")
public class Lama extends JFrame {
public Lama() {
super("My JFrame");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(300, 300);
setVisible(true);
}
public static void main(String[] args) {
new Lama();
}
public void paint( Graphics g )
{
super.paint(g);
Graphics2D to = ( Graphics2D ) g;
to.setPaint( new GradientPaint( 5, 30, Color.BLUE, 35, 100,
Color.YELLOW, true ) );
to.fill( new Ellipse2D.Double( 5, 30, 65, 100 ) );
to.getColor();
}
}