3

I couldn't understand the difference between multiple_selection_interval and single_interval_selection in JTable.

table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

next, is

table.setSelectionMode(ListSelectionModel.MULTIPLE_SELECTION_INTERVAL);

What's the difference these?

Christophe Weis
  • 2,518
  • 4
  • 28
  • 32
Venkat
  • 20,802
  • 26
  • 75
  • 84
  • What part of the API description for these values do you not understand? Why do you think we can explain it any better if we don't know what is confusing you? – camickr Mar 09 '10 at 07:08

1 Answers1

9

With ListSelectionModel.SINGLE_SELECTION you can just select one row. With ListSelectionModel.SINGLE_INTERVAL_SELECTION you can select more than one row, which are in one block. (e.g. you can select row 1 - 5, but not row 1-3 and row 4-6, therefor you need ListSelectionModel.MULTIPLE_INTERVAL_SELECTION)

Matthias Wiehl
  • 1,799
  • 16
  • 22
Georg Leber
  • 3,470
  • 5
  • 40
  • 63