java code:import javax.swing.*;
import java.awt.color.*;
import java.awt.*;public class DrawnIcon implements Icon {
private int height;
private int weight;

DrawnIcon(int height,int weight){
this.height=height;
this.weight=weight;
}
public int getIconHeight(){
return height;
}

public int getIconWidth(){
return weight;
}

public void paintIcon(Component a1,Graphics a2,int x,int y){
a2.setColor(Color.RED);
a2.fillOval(x,y,weight,height);
}

public static void main(String[] args) {

JFrame jf=new JFrame();
Container c=jf.getContentPane();
DrawnIcon icon=new DrawnIcon(15, 15);
JLabel jl=new JLabel ("测试",icon,JLabel.CENTER);
jf.setSize(100,100);
jf.setLocation(200,200);
c.add(jl);
jf.setVisible(true);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

}
我想问下public void paintIcon(Component a1,Graphics a2,int x,int y)和
a2.fillOval(x,y,weight,height);语句中x,y参数我没有初始化,这个图标X,Y有什么用,我好像也没有用到这两个参数。求高手详解!!感激不尽。