29 lines
702 B
Java
29 lines
702 B
Java
|
import java.awt.*;
|
||
|
import javax.swing.*
|
||
|
|
||
|
public class panelAttente extends JPanel{
|
||
|
|
||
|
int rayonCercle;
|
||
|
int positionCentreX;
|
||
|
int positionCentreY;
|
||
|
|
||
|
public panelAttente(int rayonCercle){
|
||
|
super();
|
||
|
this.rayonCercle=rayonCercle;
|
||
|
this.getCenter();
|
||
|
}
|
||
|
|
||
|
public Position getCenter(){
|
||
|
this.positionCentreX = this.getWidth()/2;
|
||
|
this.positionCentreY = this.getHeight()/2);
|
||
|
}
|
||
|
|
||
|
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.drawOval(this.positionCentreX, this.positionCentreY,200, 200);
|
||
|
}
|
||
|
}
|