ajout de la vue Lobby

This commit is contained in:
Daouadi Amir 2023-04-11 23:05:42 +02:00
parent c8f37a583a
commit 3fec742357
3 changed files with 40 additions and 0 deletions

1
.idea/.name Normal file
View File

@ -0,0 +1 @@
MenuPrincipal.java

39
Menu/MenuVue.java Normal file
View File

@ -0,0 +1,39 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MenuVue extends JFrame {
private JButton btnRandomGrid;
private JButton btnExistingGrid;
public MenuVue() {
ImageIcon icon = new ImageIcon("background.jpg");
JLabel label = new JLabel(icon);
btnRandomGrid = new JButton("Charger une grille aléatoire");
btnExistingGrid = new JButton("Charger une grille existante");
JPanel buttonPanel = new JPanel();
buttonPanel.add(btnRandomGrid);
buttonPanel.add(btnExistingGrid);
JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.add(label, BorderLayout.CENTER);
mainPanel.add(buttonPanel, BorderLayout.SOUTH);
setContentPane(mainPanel);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle("Menu Principal");
pack();
setLocationRelativeTo(null);
setVisible(true);
}
public void addRandomGridListener(ActionListener listener) {
btnRandomGrid.addActionListener(listener);
}
public void addExistingGridListener(ActionListener listener) {
btnExistingGrid.addActionListener(listener);
}
}

BIN
Menu/background.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB