Best Practice for Cell Editing (Single-Click or Double-Click) in Table in Swing

一笑奈何 提交于 2019-12-24 00:46:04

问题


I want to ask some questions regarding editing cell in a table.

Currently my practices of doing cell editing in a table is by double-clicking the cell to make the cell editable for text input. For the single-clicking, it will select the row instead. It just like Excel behaviour of cell editing. What I see in some of JIDE demo , some of the table can be editable using single-click such as "EditableTableHeaderDemo" and some of it can be editable using double-clicking such as JideTableDemo.

What I want to know here is the best practices of cell editing in a table whether it is single-click or double-click? Is there any issue if we use double-click to edit the table compared to the single-click to edit the table? In terms of user friendliness,usability and human computer interaction, which one is better?


回答1:


Many users prefer a key binding. F2 is a common (but not universal) default; Enter also has some appeal. Also consider making the choice part of your java.util.Preferences, mentioned here.

table.getInputMap().put(
    KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "startEditing");


来源:https://stackoverflow.com/questions/13558171/best-practice-for-cell-editing-single-click-or-double-click-in-table-in-swing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!