请帮我允许我的`JTable`搜索文本,即使表格在按键时处于可编辑模式 [英] Please help me to allow my `JTable` to search the text even the table is in editable mode on key-press

查看:107
本文介绍了请帮我允许我的`JTable`搜索文本,即使表格在按键时处于可编辑模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户开始使用键盘按键,那么 JTable 应该搜索匹配的文本,如果用户双击单元格,那么Table应该允许他编辑文本。

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.

问题是 - 表只是在表处于不可编辑模式时搜索文本,并且Table是可编辑的并且用户开始键入文本使用键盘,单元格允许他编辑单元格而不是搜索。 mKorbel先生刚刚解决了我的问题仅当双击Table cell 时才允许编辑。

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.

请帮我允许我的 JTable 搜索文本,即使表格在按键上处于可编辑模式。

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

推荐答案

试试这个:

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

这篇关于请帮我允许我的`JTable`搜索文本,即使表格在按键时处于可编辑模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆