The DefaultListSelectionModel provides the method setSelectionInterval(int start, int end) to select an interval.

But how can I select multiple intervals?

Recommended Answers

All 4 Replies

Although I haven't used it, have you tried public void addSelectionInterval(int index0,int index1) in the DefaultListSelectionModel class.
Also have you set the selection mode to MULTIPLE_INTERVAL_SELECTION .

Although I haven't used it, have you tried public void addSelectionInterval(int index0,int index1) in the DefaultListSelectionModel class.].

yes, as a wrote in my thread...

Also have you set the selection mode to MULTIPLE_INTERVAL_SELECTION .

yes, i did. but this doesn't solve my problem

thank you anyway!

Any other suggestion?

forget my last post! you were right:

first:

setSelectionInterval(int start, int end);

then:
addSelectionInterval(int start, int end);

thank you!

Mark the thread as solved please ... I wanna increase my solved threads count :P

commented: Well if he forgets to do that, I'll at least give you the rep =P +4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.