feat: ajout classe view principale

This commit is contained in:
2025-11-08 15:50:15 +01:00
parent 5bbca6047d
commit e32805bcd6

33
src/GameView.java Normal file
View File

@@ -0,0 +1,33 @@
import java.awt.Container;
import javax.swing.JFrame;
public class GameView extends JFrame implements GObserver {
protected Container window;
public GameView(String title, int width, int height, int x, int y)
{
// la fenetre
JFrame frame = new JFrame(title);
// position fenetre
frame.setLocation(x, y);
// taille fenetre
frame.setSize(width, height);
// bool pour resize la fenetre
frame.setResizable(false);
// le bouton close par defaut
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// visibilité de la fenetre
frame.setVisible(true);
// acceder a l'interieur de la fenetre
window = frame.getContentPane();
}
@Override
public boolean apply()
{
return true;
}
}