This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread 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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 5048
    
  10

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: 20136
    
  30

Isn't that what ListSelectionListeners are for?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JList selection method
 
It's not a secret anymore!