séparation des fichiers java
This commit is contained in:
16
Main.java
Normal file
16
Main.java
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
@@ -10,9 +10,9 @@ public class SudokuGrid extends JFrame {
|
|||||||
// Panneau pour la grille Sudoku
|
// Panneau pour la grille Sudoku
|
||||||
JPanel gridPanel = new JPanel();
|
JPanel gridPanel = new JPanel();
|
||||||
gridPanel.setLayout(new GridLayout(GRID_SIZE, GRID_SIZE)); // Utiliser GridLayout
|
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];
|
grid = new JTextField[GRID_SIZE][GRID_SIZE];
|
||||||
for (int i = 0; i < GRID_SIZE; i++) {
|
for (int i = 0; i < GRID_SIZE; i++) {
|
||||||
for (int j = 0; j < GRID_SIZE; j++) {
|
for (int j = 0; j < GRID_SIZE; j++) {
|
||||||
@@ -32,12 +32,5 @@ public class SudokuGrid extends JFrame {
|
|||||||
getContentPane().add(buttonPanel, BorderLayout.EAST);
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user