From 4f326ef2d17791b7e286dd6302db62d69c4c2a6d Mon Sep 17 00:00:00 2001 From: Lyanis Souidi Date: Thu, 27 Apr 2023 21:14:28 +0200 Subject: [PATCH] Modification de la page d'accueil MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajout de la transparence sur le panneau supérieur - Changement de la couleur des boutons - Ajout d'une contrainte de taille minimum de la fenêtre --- src/HomeView.java | 5 +++-- src/Window.java | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/HomeView.java b/src/HomeView.java index 725d5ec..e25fc6a 100644 --- a/src/HomeView.java +++ b/src/HomeView.java @@ -17,6 +17,7 @@ public class HomeView extends JPanel { // Création du panel pour le texte JPanel panelTexte = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); panelTexte.add(texte); + panelTexte.setOpaque(false); // Création du panel pour les boutons JPanel panelBoutons = new JPanel(new FlowLayout(FlowLayout.CENTER, 100, 200)); @@ -43,7 +44,7 @@ public class HomeView extends JPanel { JButton choisirGrille = new JButton("Générer une grille"); choisirGrille.setPreferredSize(new Dimension(250, 50)); choisirGrille.setFont(new Font("Arial", Font.BOLD, 20)); - choisirGrille.setBackground(Color.GRAY); + choisirGrille.setBackground(new Color(96, 175, 255)); choisirGrille.addActionListener(e -> { String strTaille = JOptionPane.showInputDialog(panel, "Entrez la taille de la grille :", "Taille de la grille", JOptionPane.PLAIN_MESSAGE); @@ -99,7 +100,7 @@ public class HomeView extends JPanel { JButton importerGrille = new JButton("Importer une grille"); importerGrille.setPreferredSize(new Dimension(250, 50)); importerGrille.setFont(new Font("Arial", Font.BOLD, 20)); - importerGrille.setBackground(Color.GRAY); + importerGrille.setBackground(new Color(96, 175, 255)); importerGrille.addActionListener(e -> { JFileChooser fileChooser = new JFileChooser(); diff --git a/src/Window.java b/src/Window.java index e1635b5..0761e77 100644 --- a/src/Window.java +++ b/src/Window.java @@ -10,8 +10,6 @@ public class Window extends JFrame { this.setSize(d); this.setLocationRelativeTo(null); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - System.out.println("Fenêtre :"); - System.out.println("\tLargeur de la fenêtre : " + this.getWidth() + "px"); - System.out.println("\tHauteur de la fenêtre : " + this.getHeight() + "px"); + this.setMinimumSize(new Dimension(750, 750)); } } \ No newline at end of file