|
|
|
Подсчет индексов
|
|||
|---|---|---|---|
|
#18+
Есть таблица со столбцом boolean, нужно подсчитать кол-во выбранных строк когда boolean = true, и это кол-во занести в переменную Нашел индексы строк когда boolean true Теперь хочу подсчитать кол-во индексов, и занести в переменную, как это организовать? (Установил столбцу boolean 5 true из 100, в переменную упала значение 5 ...) table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { if (table.getSelectedRow() >= 0) { for (int i = 0; i < table.getRowCount(); i++) { if (isRowChecked((Boolean) table.getValueAt(i, table.getColumnModel().getColumnIndex("Столбец")))==true) { System.out.println(i); } } } } } }); ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.07.2017, 11:03 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=63&tid=2122737]: |
0ms |
get settings: |
12ms |
get forum list: |
16ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
24ms |
get topic data: |
7ms |
get forum data: |
6ms |
get page messages: |
20ms |
get tp. blocked users: |
1ms |
| others: | 204ms |
| total: | 294ms |

| 0 / 0 |
