From ba02e03b806f8504a7a210ceba9809819f6c11ff Mon Sep 17 00:00:00 2001 From: keraudre Date: Sat, 27 Apr 2024 15:46:35 +0200 Subject: [PATCH] =?UTF-8?q?s=C3=A9paration=20des=20fichiers=20java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Main.java | 16 ++++++++++++++++ SudokuGrid.java | 13 +++---------- 2 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 Main.java diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..e555be7 --- /dev/null +++ b/Main.java @@ -0,0 +1,16 @@ +import javax.swing.*; +import java.awt.*; + +public class Main { + + public static void main(String[] args) { + + // affichage et création de la fenetre + + SudokuGrid sudokuGrid = new SudokuGrid(); + sudokuGrid.setSize(700,600); + sudokuGrid.setLocation(100, 100); + sudokuGrid.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + sudokuGrid.setVisible(true); + } +} diff --git a/SudokuGrid.java b/SudokuGrid.java index 50925de..c8b14f3 100644 --- a/SudokuGrid.java +++ b/SudokuGrid.java @@ -10,9 +10,9 @@ public class SudokuGrid extends JFrame { // Panneau pour la grille Sudoku JPanel gridPanel = new JPanel(); gridPanel.setLayout(new GridLayout(GRID_SIZE, GRID_SIZE)); // Utiliser GridLayout - gridPanel.setBackground(new Color(0, 255, 0)); // Fond vert + gridPanel.setBackground(Color.green); // Fond vert - // Initialiser le grid + // Initialiser la grille grid = new JTextField[GRID_SIZE][GRID_SIZE]; for (int i = 0; i < GRID_SIZE; i++) { for (int j = 0; j < GRID_SIZE; j++) { @@ -32,12 +32,5 @@ public class SudokuGrid extends JFrame { getContentPane().add(buttonPanel, BorderLayout.EAST); } - public static void main(String[] args) { - // afficage et création de la fenetre - SudokuGrid sudokuGrid = new SudokuGrid(); - sudokuGrid.setSize(700,600); - sudokuGrid.setLocation(100, 100); - sudokuGrid.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - sudokuGrid.setVisible(true); - } + }