32 lines
1.1 KiB
Java
32 lines
1.1 KiB
Java
|
import javax.swing.*;
|
||
|
import java.awt.*;
|
||
|
|
||
|
|
||
|
public class FenetreChoix {
|
||
|
public void afficher() {
|
||
|
JFrame choixFrame = new JFrame("Choix de résolution du Sudoku");
|
||
|
choixFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||
|
choixFrame.setSize(400, 200);
|
||
|
choixFrame.setLayout(new BorderLayout());
|
||
|
choixFrame.setLocationRelativeTo(null);
|
||
|
|
||
|
JLabel label = new JLabel("Choisissez le mode de résolution du Sudoku :");
|
||
|
label.setHorizontalAlignment(JLabel.CENTER);
|
||
|
|
||
|
JButton automatiqueButton = new JButton("Automatique");
|
||
|
JButton manuelButton = new JButton("Manuel");
|
||
|
|
||
|
JPanel boutonsPanel = new JPanel();
|
||
|
boutonsPanel.setLayout(new FlowLayout());
|
||
|
boutonsPanel.add(automatiqueButton);
|
||
|
boutonsPanel.add(manuelButton);
|
||
|
|
||
|
choixFrame.add(label, BorderLayout.NORTH);
|
||
|
choixFrame.add(boutonsPanel, BorderLayout.CENTER);
|
||
|
choixFrame.setVisible(true);
|
||
|
|
||
|
automatiqueButton.addActionListener(new AutomatiqueActionListener(choixFrame));
|
||
|
manuelButton.addActionListener(new ManuelActionListener(choixFrame));
|
||
|
}
|
||
|
}
|