This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes JList selection method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList selection method" Watch "JList selection method" New topic
Author

JList selection method

Mansoor Akhtar
Greenhorn

Joined: Jul 11, 2010
Posts: 12
Hi,

I would like to know which method is called when a mouse is clicked on a JList item? I mean which method is responsible for its selection?
I need to override that method for some custom behavior.

Thanks.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4530
    
    5

Read the sources if you really want to know something that
(a) is undocumented, so may not be the same across all releases
(b) is undocumented, so may not be the same across all Look&Feels
(c) is undocumented, so will almost certainly come back to bite you in the butt when you least expect it.

Do you really need some custom behavior to apply when the user clicks the mouse to make a selection, and normal, decustomised behavior when the selection is made using the keyboard?

What custom behavior?


luck, db
There are no new questions, but there may be new answers.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

Isn't that what ListSelectionListeners are for?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JList selection method