Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2065

ListSelectionListener Res

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Hal Vaughan" <hal.vaughan@THRWHITE.remove-dii-this>
Subject ListSelectionListener Res
Message-ID <44-dnRhl6_OnVwbbnZ2dnUVZ_oimnZ2d@comcast.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 29
Date Wed, 27 Apr 2011 15:36:59 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918619 96.60.20.240 (Wed, 27 Apr 2011 10:36:59 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:36:59 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:2065

Show key headers only | View raw


  To: comp.lang.java.gui
This seems quite different than the issue I had with an ActionListener
responding twice (it was added twice).  I've even checked to make sure this
list box has only one ListSelectionListener.

I have a JList that allows multiple interval selection and the
ListSelectionListener is called when I press the mouse button down and when
I release it.  Somewhere along the way, I also get a third event.  I added
a line to the start of the valueChanged() method and it prints once when I
press down on the left mouse button and twice more when I let the button
up.

I can't find anything in the ListSelectionEvent that lets me check to see if
the event is from a mouse button down or up or a mouse click and I haven't
found a reference to this happening.  I haven't had this problem before, so
I could see how it's related to allowing multiple intervals, but I'm still
not clear on what is going on.

Why am I getting multiple ListSelectionEvents and what do I do if all I want
is one so I can then get the selected indices from the list?

Thanks!

Hal

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar | Unroll thread


Thread

ListSelectionListener Res "Hal Vaughan" <hal.vaughan@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
  Re: ListSelectionListener "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
    Re: ListSelectionListener "Hal Vaughan" <hal.vaughan@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
      Re: ListSelectionListener "Hal Vaughan" <hal.vaughan@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
      Re: ListSelectionListener "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
  Re: ListSelectionListener "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000

csiph-web