Please help me to allow my `JTable` to search the text even the table is in editable mode on key-press

▼魔方 西西 提交于 2019-12-22 18:25:26

问题


If user starts pressing keys using keyboards then JTable is supposed to be searched the matching text for him and if user double clicks on cell then Table should allow him to edit the text.

And the issue is - Table is only searching text when the table is in non-editable mode and if Table is editable and user starts typing the text-using keyboard, cell is allowing him to edit the cell rather then search. Mr mKorbel has just solved my issue to allow edit only if double click on Table cell.

Please help me to allow my JTable to search the text even the table is in editable mode on key-press.


回答1:


Try this:

table.putClientProperty("JTable.autoStartsEdit", Boolean.FALSE);


来源:https://stackoverflow.com/questions/9975339/please-help-me-to-allow-my-jtable-to-search-the-text-even-the-table-is-in-edit

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