• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make JList ListSelectionListener execute only once?

 
Kevin Pang
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is ,when I click the JList once ,the jList1ValueChanged() will execute twice.
how to make it run once?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the event's getValueIsAdjusting() method. It should return true the first time, false the second time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!