import javax.swing.*; import java.awt.*; public class Rose{ public static void main(String[] args) { JFrame fenetre = new JFrame(); fenetre.setSize(270, 270); fenetre.setLocation(100, 100); fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GridLayout gestionnaire = new GridLayout(3, 3); fenetre.setLayout(gestionnaire); JLabel etiquette1 = new JLabel("Mystral"); JLabel etiquette2 = new JLabel("Tramontane"); JLabel etiquette3 = new JLabel("Grec"); JLabel etiquette4 = new JLabel("Ponant"); JLabel etiquette5 = new JLabel(" "); JLabel etiquette6 = new JLabel("Levant"); JLabel etiquette7 = new JLabel("Libeccio"); JLabel etiquette8 = new JLabel("Marin"); JLabel etiquette9 = new JLabel("Sirocco"); etiquette1.setHorizontalAlignment(JLabel.LEFT); etiquette2.setHorizontalAlignment(JLabel.CENTER); etiquette3.setHorizontalAlignment(JLabel.RIGHT); etiquette4.setHorizontalAlignment(JLabel.LEFT); etiquette5.setHorizontalAlignment(JLabel.CENTER); etiquette6.setHorizontalAlignment(JLabel.RIGHT); etiquette7.setHorizontalAlignment(JLabel.LEFT); etiquette8.setHorizontalAlignment(JLabel.CENTER); etiquette9.setHorizontalAlignment(JLabel.RIGHT); etiquette1.setVerticalAlignment(JLabel.TOP); etiquette2.setVerticalAlignment(JLabel.TOP); etiquette3.setVerticalAlignment(JLabel.TOP); etiquette4.setVerticalAlignment(JLabel.CENTER); etiquette5.setVerticalAlignment(JLabel.CENTER); etiquette6.setVerticalAlignment(JLabel.CENTER); etiquette7.setVerticalAlignment(JLabel.BOTTOM); etiquette8.setVerticalAlignment(JLabel.BOTTOM); etiquette9.setVerticalAlignment(JLabel.BOTTOM); fenetre.add(etiquette1, BorderLayout.CENTER); fenetre.add(etiquette2, BorderLayout.CENTER); fenetre.add(etiquette3, BorderLayout.CENTER); fenetre.add(etiquette4, BorderLayout.CENTER); fenetre.add(etiquette5, BorderLayout.CENTER); fenetre.add(etiquette6, BorderLayout.CENTER); fenetre.add(etiquette7, BorderLayout.CENTER); fenetre.add(etiquette8, BorderLayout.CENTER); fenetre.add(etiquette9, BorderLayout.CENTER); fenetre.setVisible(true); } }