File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JList selection method

 
Mansoor Akhtar
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't that what ListSelectionListeners are for?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic