This commit is contained in:
Emmanuel Srivastava
2025-01-30 15:58:46 +01:00
parent b1fa4d63d9
commit 1859f1cb67
9 changed files with 169 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import javax.swing.*;
import java.awt.*;
public class Rose {
public static void main(String[] args) {
JFrame frame = new JFrame("Rose");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Créer un panel avec un GridLayout pour organiser les labels
JPanel panel = new JPanel(new GridLayout(0, 1)); // Une colonne, autant de lignes que nécessaire
// Ajouter les labels avec les noms
panel.add(new JLabel("Mystral", SwingConstants.CENTER));
panel.add(new JLabel("Tramontane", SwingConstants.CENTER));
panel.add(new JLabel("Grec", SwingConstants.CENTER));
panel.add(new JLabel("Ponant", SwingConstants.CENTER));
panel.add(new JLabel("Levant", SwingConstants.CENTER));
panel.add(new JLabel("Libeccio", SwingConstants.CENTER));
panel.add(new JLabel("Marin", SwingConstants.CENTER));
panel.add(new JLabel("Sirocco", SwingConstants.CENTER));
// Ajouter le panel à la frame
frame.add(panel, BorderLayout.CENTER);
// Configurer la taille et la position de la frame
frame.setSize(300, 200);
frame.setLocationRelativeTo(null); // Centrer la fenêtre sur l'écran
frame.setVisible(true);
}
}