This commit is contained in:
Wilfried BRIGITTE 2024-04-22 15:38:29 +02:00
parent ca3592cc83
commit c9efc37ef3
2 changed files with 39 additions and 17 deletions

37
Sudoku/Makefile Normal file
View File

@ -0,0 +1,37 @@
### VARIABLES ###
JC = javac
JCFLAGS = -encoding UTF-8 -implicit:none
JVM = java
JVMFLAGS =
### REGLES ESSENTIELLES ###
main.class : main.java menu.class
${JC} ${JCFLAGS} main.java
grille.class : grille.java resolveurGrille.class
${JC} ${JCFLAGS} grille.java
menu.class : menu.java resolveurGrille.class grille.class
${JC} ${JCFLAGS} menu.java
resolveurGrille.class : resolveurGrille.java
${JC} ${JCFLAGS} resolveurGrille.java
### REGLES OPTIONNELLES ###
run : main.class
${JVM} ${JVMFLAGS} main
clean :
-rm -f *.class
mrproper : clean main.class
### BUTS FACTICES ###
.PHONY : run clean mrproper
### FIN ###

View File

@ -15,8 +15,8 @@ public class grille extends JComponent{
public static void AfficherGrille (int[][] grille, boolean editable) { public static void AfficherGrille (int[][] grille, boolean editable) {
/*paramètre de base de la fenetre*/ /*paramètre de base de la fenetre*/
JFrame fenetre = new JFrame(); JFrame fenetre = new JFrame();
fenetre.setSize(900, 1100); fenetre.setSize(900, 950);
fenetre.setResizable(false); /*fenetre.setResizable(false);*/
fenetre.setLocationRelativeTo(null); fenetre.setLocationRelativeTo(null);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
/*Panneau pour la grille */ /*Panneau pour la grille */
@ -127,19 +127,4 @@ public class grille extends JComponent{
return null; return null;
} }
class LimitJTextField extends PlainDocument {
private int max;
LimitJTextField(int max) {
super();
this.max = max;
}
public void insertString(int offset, String text, AttributeSet attr) throws BadLocationException {
if (text == null)
return;
if ((getLength() + text.length()) <= max) {
super.insertString(offset, text, attr);
}
}
}
} }