|
Replies:
1
-
Last Post:
Oct 22, 2008 3:49 AM
by: walterln
|
Threads:
[
Previous
|
Next
]
|
|
|
|
|
|
JList SelectionEvent Problem (On mouse press it works twice)
Posted:
Oct 21, 2008 10:11 PM
|
|
|
Hi
I have a strange problem in my swing application. Problem arises when i call a selection listener on a jlist. what i am doing is :- i am calling a database method from my selection event block and in db side i am firing a query in the database after that i display all the data on my JTable Object. But there is ambiguity in the behavior of the JList's Selection event. When i select an element in JList by the Keyboards UP and Down arrow button then code working fine that means query executed once.....But when i select an element from mouse then my query executed twice....how i can handle that situation in the JList's selectionEvent.
|
|
|
|
|
|
|
Re: JList SelectionEvent Problem (On mouse press it works twice)
Posted:
Oct 22, 2008 3:49 AM
in response to: sandeep_mandori
|
|
|
In case of the mouse click two events are fired: -deselecting the old row -selecting the new row
The first event has ListSelectionEvent#getValueIsAdjusting() set to true, so don't respond in that case.
|
|
|
|
|