[求助]关于2D的代码解释
请帮助我解释下面两句代码
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
public class demo extends JFrame{
public demo(){
super("demo");
setSize(300,200);
setVisible(true);
}
public void paint(Graphics g){
super.paint(g); //这一句;
Graphics2D g2d = (Graphics2D)g; //这一句;
g2d.setPaint(new GradientPaint(5,30,Color.BLUE,35,100,Color.yellow,true));
g2d.fill(new Ellipse2D.Double(5,30,65,100));
}
public static void main(String args[]){
demo application = new demo();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}