开发者

Selection mode in JTable?

开发者 https://www.devze.com 2022-12-22 20:14 出处:网络
I couldn\'t understand the difference between multiple_selection_interval and singl开发者_C百科e_interval_selection in JTable.

I couldn't understand the difference between multiple_selection_interval and singl开发者_C百科e_interval_selection in JTable.

table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

next, is

table.setSelectionMode(ListSelectionModel.MULTIPLE_SELECTION_INTERVAL);

What's the difference these?


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号