JList中右键选中行

JList中右键选中行

实现MouseListener的方法

    public void mousePressed(MouseEvent e) {
        if(e.getButton()==3){
            int index=peoplePane.locationToIndex(e.getPoint());
             peoplePane.setSelectedIndex(index);  
        }
    }

 

你可能感兴趣的:(JList)