you want.
Of course you can use other listeners or approaches.
That's just first thing which came to my mind.
Alex.http://www.myjavaserver.com/~alexfromohio/
Thanks, but how would you know whether the second click was on the
last item or on the empty space?
That's not about second or third click. It's about having additional
control/listener/approach.
JList does act on each click notifying listeners. When mouse clicked
outside of existing items it assumes that last item was clicked.
But when you listen for mouse too you can see mouse coordinates and
decide was it close enough to last item to actually make selection or
it was empty area. And based on your decision you can even deselect
this last item and act only as for empty area.
Using mouse pressed and released methods you can act before or after
selection listeners acts.
You also can use the same changelistener to catch actual selection
events and compare them to mouselisteners events and calculate actual
size and bounds of real empty area and act accordingly.
After all you can retrieve size and bounds of real JList as real
Component, calculate where empty area is and act accordingly.
Possibilities are endless. Choose one which is comfortable/achievable
for you or ask somebody who's affordable for you (for example me) and,
actually, there is no problem at all.
That's why I love Java. You can do whatever you can imagine. Which is
the only limit.
Alex.
--http://www.myjavaserver.com/~alexfromohio/- Hide quoted text -
- Show quoted text -
Thanks. What methods tell me the coordinates of the actual items in