1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
public class Plateau extends JPanel
{
private JLabel pacman;
private JLabel vie;
public Plateau()
{
super();
//Ajout de la bordure
this.setBackground(Color.WHITE);
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
pacman = new JLabel("PACMAN");
vie = new JLabel("Vie(s) : ");
this.setLayout(new BorderLayout());
this.add(pacman, BorderLayout.NORTH);
pacman.setAlignmentY(JComponent.CENTER_ALIGNMENT);
pacman.setAlignmentX(JComponent.CENTER_ALIGNMENT);
this.add(vie, BorderLayout.SOUTH);
}
} |
Partager