wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes addSelectionInterval() and setSelectionInterval() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "addSelectionInterval() and setSelectionInterval()" Watch "addSelectionInterval() and setSelectionInterval()" New topic
Author

addSelectionInterval() and setSelectionInterval()

mani the blues
Greenhorn

Joined: Jul 08, 2011
Posts: 2
What is the difference between DefaultListSelectionModel.addSelectionInterval() and DefaultListSelectionModel.setSelectionInterval() and DefaultListSelectionModel.setLeadSelectionIndex() ?

Where to use these methods ?

Thanks in advance.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Have you read the API for those methods? What specific phrase or sentence don't you understand?


luck, db
There are no new questions, but there may be new answers.
mani the blues
Greenhorn

Joined: Jul 08, 2011
Posts: 2
Hi,
Thanks for the response.

"In SINGLE_SELECTION selection mode, this is equivalent to calling setSelectionInterval, and only the second index is used. In SINGLE_INTERVAL_SELECTION selection mode, this method behaves like setSelectionInterval, unless the given interval is immediately adjacent to or overlaps the existing selection, and can therefore be used to grow it."

AFAIK, this method is used to highlight (select) a row by coding.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Please check your private messages for an important administrative matter.
 
 
subject: addSelectionInterval() and setSelectionInterval()