与选择table row
类似,我们可以自动选择tableview
的tableview
的JavaFX
吗?在javafx中自动选择一个表格列表
自动,我的意思是,如果我按down arrow key
,只single column
需要进行选择,而不是一个all columns of single row
感谢
与选择table row
类似,我们可以自动选择tableview
的tableview
的JavaFX
吗?在javafx中自动选择一个表格列表
自动,我的意思是,如果我按down arrow key
,只single column
需要进行选择,而不是一个all columns of single row
感谢
,如果你选择模型的cellSelectionEnabled
属性设置为true
,你能选择单个单元格。
使用箭头键可以将选择选项移动到由箭头确定的聚焦细胞方向旁边的单元格。
// selection for single cells instead of single
table.getSelectionModel().setCellSelectionEnabled(true);
// select third cell in first (possibly nested) column
table.getSelectionModel().clearAndSelect(2, table.getVisibleLeafColumn(0));
// focus the same cell
table.getFocusModel().focus(2, table.getVisibleLeafColumn(0));
你需要说明你的意思。你的意思是你想要选择一列中的单个单元格还是全部单元格?表格由行,列和单元格组成,您需要明确说明您要选择的内容。对我来说,听起来你想为特定的列选择所有的单元格,但当按下“向下箭头键”时没有意义。 –
我更新了我的问题 – UVM
请问'table.getSelectionModel()。setCellSelectionEnabled(true);'完成你想要的吗?它允许您选择单个单元而不是整行。 –