Files
TD3_DEV51_raban_felix-vi/src/fr/iut/Projet/Action.java

32 lines
931 B
Java
Raw Normal View History

2025-10-08 11:15:14 +02:00
package fr.iut.Projet;
import javax.swing.*;
import java.awt.*;
2025-10-08 11:20:15 +02:00
/**
* Classe Action représentant la fenêtre principale du jeu "Hanging Man".
* Affiche un message de bienvenue.
*/
2025-10-08 11:15:14 +02:00
public class Action {
2025-10-08 11:20:15 +02:00
/**
* Constructeur. Crée et affiche la fenêtre du jeu avec un message.
*/
2025-10-08 11:15:14 +02:00
public Action() {
2025-10-08 11:20:15 +02:00
// Création de la fenêtre du jeu
JFrame gameFrame = new JFrame("Hanging Man");
2025-10-08 11:15:14 +02:00
gameFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
gameFrame.setSize(1040, 1000);
gameFrame.setLayout(new BorderLayout());
2025-10-08 11:20:15 +02:00
// Label de bienvenue
2025-10-08 11:15:14 +02:00
JLabel label = new JLabel("Bienvenue dans le jeu !");
label.setFont(new Font("Arial", Font.BOLD, 28));
label.setHorizontalAlignment(SwingConstants.CENTER);
2025-10-08 11:20:15 +02:00
// Ajouter le label et afficher la fenêtre
2025-10-08 11:15:14 +02:00
gameFrame.add(label, BorderLayout.CENTER);
gameFrame.setVisible(true);
}
}