TP
This commit is contained in:
BIN
DEV2.1/Sudoku/Case.class
Normal file
BIN
DEV2.1/Sudoku/Case.class
Normal file
Binary file not shown.
26
DEV2.1/Sudoku/Case.java
Normal file
26
DEV2.1/Sudoku/Case.java
Normal file
@@ -0,0 +1,26 @@
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
|
||||
public class Case extends JComponent {
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics pinceau) {
|
||||
Graphics secondPinceau = pinceau.create();
|
||||
|
||||
if (this.isOpaque()) {
|
||||
secondPinceau.setColor(this.getBackground());
|
||||
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
}
|
||||
|
||||
secondPinceau.setColor(Color.BLACK);
|
||||
secondPinceau.drawRect(0, 0, this.getWidth()-3, this.getHeight()-3);
|
||||
secondPinceau.drawRect(1, 1, this.getWidth()-4, this.getHeight()-4);
|
||||
secondPinceau.drawRect(2, 2, this.getWidth()-5, this.getHeight()-5);
|
||||
|
||||
for (int i = 0; i != 3; i++) {
|
||||
for (int j = 0; j != 3; j++) {
|
||||
secondPinceau.drawRect(this.getWidth()*i/3, this.getHeight()*j/3, this.getWidth()/3, this.getHeight()/3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
DEV2.1/Sudoku/Graphique.class
Normal file
BIN
DEV2.1/Sudoku/Graphique.class
Normal file
Binary file not shown.
17
DEV2.1/Sudoku/Graphique.java
Normal file
17
DEV2.1/Sudoku/Graphique.java
Normal file
@@ -0,0 +1,17 @@
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
|
||||
public class Graphique extends JFrame {
|
||||
|
||||
public Graphique() {
|
||||
this.setSize(600, 600);
|
||||
this.setLocation(100, 100);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
this.setLayout(new GridLayout(9, 9));
|
||||
|
||||
for (int i = 0; i != 81; i++) {
|
||||
this.add(new JTextField());
|
||||
}
|
||||
}
|
||||
}
|
BIN
DEV2.1/Sudoku/Main.class
Normal file
BIN
DEV2.1/Sudoku/Main.class
Normal file
Binary file not shown.
6
DEV2.1/Sudoku/Main.java
Normal file
6
DEV2.1/Sudoku/Main.java
Normal file
@@ -0,0 +1,6 @@
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Graphique fenetre = new Graphique();
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user