APL/APL2.1/TP9/playlist/Playlist.java

29 lines
729 B
Java

import javax.swing.*;
import java.awt.*;
public class Playlist
{
public Playlist()
{
JFrame fenetre = new JFrame();
fenetre.setSize(250, 500);
fenetre.setLocation(100, 100);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridLayout gestionnaire = new GridLayout(10, 1);
fenetre.setLayout(gestionnaire);
for (int i = 0; i < 10; i++)
{
JLabel lab = new JLabel("Morceau n°" + (i+1));
PlaylistListener listener = new PlaylistListener(lab);
lab.addMouseListener(listener);
fenetre.add(lab);
}
fenetre.setVisible(true);
}
}