Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selection mode in JTable?

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?

like image 421
Venkat Avatar asked Jun 24 '26 22:06

Venkat


1 Answers

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)

like image 141
Georg Leber Avatar answered Jun 27 '26 12:06

Georg Leber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!