19 lines
528 B
Java
19 lines
528 B
Java
import java.awt.*;
|
|
import javax.swing.*;
|
|
import java.awt.event.WindowEvent;
|
|
import java.awt.event.WindowListener;
|
|
|
|
public class CercleMagenta extends JComponent {
|
|
@Override
|
|
public void paintComponent(Graphics pinceau) {
|
|
Graphics secondPinceau = pinceau.create();
|
|
|
|
if (this.isOpaque()) {
|
|
secondPinceau.setColor(this.getBackground());
|
|
secondPinceau.drawRect(0, 0, this.getWidth(), this.getHeight());
|
|
}
|
|
|
|
secondPinceau.setColor(Color.MAGENTA);
|
|
secondPinceau.fillOval(0, 0, this.getWidth(), this.getHeight());
|
|
}
|
|
} |