TP Exceptions

This commit is contained in:
Simoes Lukas
2025-03-12 17:10:44 +01:00
parent 2a0aa37baa
commit cf33623a5d
45 changed files with 448 additions and 23 deletions

View File

@@ -2,33 +2,57 @@ import java.awt.*;
import javax.swing.*;
public class Fenetre extends JFrame {
private JLabel2 actif;
private boolean estActif;
public Fenetre() {
this.estActif = false;
this.setLocation(100, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new GridLayout(14, 1));
JLabel[] chromakopia = {
new JLabel("St. Chroma"),
new JLabel("Rah Tah Tah"),
new JLabel("Noid"),
new JLabel("Darling, I"),
new JLabel("Hey Jane"),
new JLabel("I Killed You"),
new JLabel("Judge Judy"),
new JLabel("Sticky"),
new JLabel("Take Your Mask Off"),
new JLabel("Tomorrow"),
new JLabel("Thought I Was Dead"),
new JLabel("Like Him"),
new JLabel("Balloon"),
new JLabel("I Hope You Find Your Way Home")
JLabel2[] chromakopia = {
new JLabel2("St. Chroma"),
new JLabel2("Rah Tah Tah"),
new JLabel2("Noid"),
new JLabel2("Darling, I"),
new JLabel2("Hey Jane"),
new JLabel2("I Killed You"),
new JLabel2("Judge Judy"),
new JLabel2("Sticky"),
new JLabel2("Take Your Mask Off"),
new JLabel2("Tomorrow"),
new JLabel2("Thought I Was Dead"),
new JLabel2("Like Him"),
new JLabel2("Balloon"),
new JLabel2("I Hope You Find Your Way Home")
};
for (JLabel titre : chromakopia) {
this.addMouseListener(new GestionSouris(titre));
for (JLabel2 titre : chromakopia) {
GestionSouris gestion = new GestionSouris(titre, this);
titre.addMouseListener(gestion);
titre.setGestionnaireSouris(gestion);
this.add(titre);
}
this.pack();
}
public boolean getEstActif() {
return this.estActif;
}
public void setEstActif(boolean n) {
this.estActif = n;
}
public void setActif(JLabel2 n) {
this.actif = n;
}
public JLabel2 getActif() {
return this.actif;
}
}