• Post Reply Bookmark Topic Watch Topic
  • New Topic

Double Click for JList

 
Freya Tan
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently i'm using a Button to click and display some data, but i would like to have the JList to be able to double clicked to display data.. how can this be done..???
 
Minal Shah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this add MouseListener to the list.
MouseListener mouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent mouseEvent) {
if (mouseEvent.getClickCount() == 2 ) {
statement;
}
};
list.addMouseListener(mouseListener);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!