java - How can I check to see if a valueChanged event of a Swing JList was changed via click or mouse? -


here's example code, using groovy's swingbuilder create code valuechanged event of jlist:

    mainlist.valuechanged = { event ->         if (event.isadjusting) {             index = mainlist.selectedindex             otherlist.clearselection()             otherindex = otherlist.selectedindex         } else {             mainlistselected = true             clearjlist(otherlist)         }     } 

i have 2 jlist's, , function kind of controls list allowed selected via mainlistselected variable. have change int eindex want use selection based on whether or not it's index mainlist or otherlist

i've read event.isadjusting, , fires twice on mouse click event. knowledge, think move out of there, need things happen differently if mouse causes event opposed using arrows. however, code, using arrow key navigation prevents index ever changing.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

Ansible warning on jinja2 braces on when -

html - How to custom Bootstrap grid height? -