This commit is contained in:
Emmanuel Srivastava
2025-03-05 21:21:31 +01:00
parent a5e2408acd
commit e816d5e5d5
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
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) {}
}

View File

@@ -0,0 +1,15 @@
import javax.swing.*;
import java.awt.*;
public class MainFond {
public static void main(String[] args) {
JFrame frame = new JFrame("Attente");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Attente test = new Attente();
frame.setSize(500,500);
frame.setLocation(500,250);
frame.setVisible(true);
}
}