删除对可编辑jtable单元格的关注 [英] Remove focus on editable jtable cell

查看:98
本文介绍了删除对可编辑jtable单元格的关注的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

双击jtable的可编辑单元格时,如此处显示。

When double click on editable cell of jtable it shown as here.

我需要的是如果用户在输入值之前按下鼠标在按钮之外,则应自动输入现有值,输出应显示如下。

what i need is if user click mouse outside table of press a button before entering the value then existing value should be auto entered and output should be shown as follow.

任何帮助或建议将不胜感激。

Any help or suggestion would be greatly appreciated.

推荐答案


  1. 对于DefaultTableModel默认工作 myJTable.putClientProperty(terminateEditOnFocusLost,Boolean.TRUE);

覆盖 stopCellEditing()

a) public boolean stopCellEditing()

b) myJTable.getCellEditor()。stopCellEditing();

c) myJTable.getCellEditor(row,col).stopCellEditing();

这篇关于删除对可编辑jtable单元格的关注的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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