TP
This commit is contained in:
19
DEV2.1/TP08/CercleMagenta.java
Normal file
19
DEV2.1/TP08/CercleMagenta.java
Normal file
@@ -0,0 +1,19 @@
|
||||
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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user