|
|
@@ -1,14 +1,16 @@
|
|
|
package main;
|
|
|
|
|
|
+import javax.imageio.ImageIO;
|
|
|
import javax.swing.*;
|
|
|
import java.awt.*;
|
|
|
+import java.io.File;
|
|
|
|
|
|
public class View extends JFrame {
|
|
|
|
|
|
private JButton boutonExport= new JButton("Exporter");
|
|
|
private JButton boutonReset = new JButton("Décocher cases");
|
|
|
private JPanel pan = new JPanel();
|
|
|
- private GridLayout grid = new GridLayout();
|
|
|
+ private JPanel panimg = new JPanel();
|
|
|
|
|
|
public static void main(String[] args){
|
|
|
new View();
|
|
|
@@ -16,13 +18,31 @@ public class View extends JFrame {
|
|
|
|
|
|
public View(){
|
|
|
this.setTitle("Jul Project");
|
|
|
- this.setSize(800, 800);
|
|
|
+ this.setSize(800, 1040);
|
|
|
this.setLocationRelativeTo(null);
|
|
|
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
this.setLayout(new BorderLayout());
|
|
|
this.getContentPane().add((pan), BorderLayout.SOUTH);
|
|
|
+ this.getContentPane().add((panimg), BorderLayout.CENTER);
|
|
|
+
|
|
|
+ panimg.setLayout(new GridLayout(5,4));
|
|
|
+ for (int i=0;i<20;i++){
|
|
|
+ JButton button = new JButton();
|
|
|
+ button.setSize(new Dimension(200,200));
|
|
|
+ try {
|
|
|
+
|
|
|
+ ImageIcon icone = new ImageIcon("./jul_img/jul.png");
|
|
|
+ Image img = icone.getImage().getScaledInstance(button.getWidth(),button.getHeight(), Image.SCALE_DEFAULT);
|
|
|
+ button.setIcon(new ImageIcon(img));
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ex.printStackTrace();
|
|
|
+ }
|
|
|
+ panimg.add(button);
|
|
|
+ }
|
|
|
+
|
|
|
pan.add(boutonExport);
|
|
|
pan.add(boutonReset);
|
|
|
+
|
|
|
this.setVisible(true);
|
|
|
}
|
|
|
}
|