13 Interfacce e polimorfismo Sandro Pedrazzini Implementazione (2) public class WorldIcon implements Icon{ private int fSize; public WorldIcon(int size){ fSize = size; } public void paintIcon(Component c, Graphics g, int x, int y) { Graphics2D g2 = (Graphics2D)g; Ellipse2D.Double world = new Ellipse2D.Double(x,y,fSize, fSize); g2.setColor(Color.BLUE); g2.fill(world); } public int getIconWidth() { return fSize; } public int getIconHeight() { return fSize; }
{}