37 lines
1.1 KiB
Java
37 lines
1.1 KiB
Java
import java.awt.*;
|
|
import java.awt.event.*;
|
|
import javax.swing.*;
|
|
|
|
public class Attente extends JComponent implements WindowsListener {
|
|
public Attente() {
|
|
super();
|
|
|
|
}
|
|
|
|
@Override
|
|
protected void paintComponent(Graphics pinceau) {
|
|
Graphics secondPinceau = pinceau.create();
|
|
secondPinceau.setColor(this.getForeground());
|
|
|
|
int col = 5;
|
|
int ligne = 5;
|
|
int caseWidth = getWidth() / col;
|
|
int caseHeight = getHeight() / ligne;
|
|
secondPinceau.setColor(Color.CYAN);
|
|
int[] xPoints = {0,caseWidth * col, 0, caseWidth * col};
|
|
int[] yPoints = {0,0,caseHeight * ligne, caseHeight * ligne};
|
|
secondPinceau.fillPolygon(xPoints, yPoints, 4);
|
|
}
|
|
|
|
@Override
|
|
protected void windowDeactivated(WindowEvent evenement) {
|
|
System.out.println("Fenetre arri pl")
|
|
}
|
|
|
|
@Override public void windowActivated(WindowsEvent e) {}
|
|
@Override public void windowOpened(WindowsEvent e) {}
|
|
@Override public void windowClosing(WindowsEvent e) {}
|
|
@Override public void windowClosed(WindowsEvent e) {}
|
|
@Override public void windowIconified(WindowsEvent e) {}
|
|
@Override public void windowDeiconified(WindowsEvent e) {}
|
|
} |