ajout de la vue Lobby
This commit is contained in:
parent
c8f37a583a
commit
3fec742357
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@ -0,0 +1 @@
|
||||
MenuPrincipal.java
|
39
Menu/MenuVue.java
Normal file
39
Menu/MenuVue.java
Normal 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
BIN
Menu/background.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
Loading…
Reference in New Issue
Block a user