1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Personnes = new JList();
Personnes.setName("Personnes");
Personnes.setFont(new java.awt.Font("Arial", 1, 12));
Personnes.setForeground(java.awt.Color.white);
Personnes.setDragEnabled(false);
Personnes.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
{
if ( e.getClickCount() == 2)
{
retour();
}
}
});
Personnes.setSelectionModel(new DefaultListSelectionModel()
{
private static final long serialVersionUID = 1L;
public void setSelectionInterval(int index0, int index1) {
if (index0 == index1) {
if (isSelectedIndex(index0)) {
removeSelectionInterval(index0, index0);
return;
}
}
super.setSelectionInterval(index0, index1);
}
@Override
public void addSelectionInterval(int index0, int index1) {
if (index0 == index1) {
if (isSelectedIndex(index0)) {
removeSelectionInterval(index0, index0);
return;
}
super.addSelectionInterval(index0, index1);
}
}
}); |
Partager