import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Cercle extends JComponent{ private int volume; public Cercle(){ super(); this.volume=0; } public void setVolume(int volume){ this.volume=volume; } protected void paintComponent(Graphics pinceau){ Graphics secondPinceau = pinceau.create(); if (this.isOpaque()){ secondPinceau.setColor(this.getBackground()); secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); } secondPinceau.setColor(Color.BLACK); secondPinceau.fillRect(0,0,this.getWidth(), this.getHeight()); secondPinceau.setColor(Color.YELLOW); for(int i=0;i