Remove focus on editable jtable cell

你说的曾经没有我的故事 提交于 2019-11-30 09:05:23

问题


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:


  1. for DefaultTableModel works by default myJTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);

  2. override stopCellEditing()

    a) public boolean stopCellEditing()

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

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



来源:https://stackoverflow.com/questions/12884234/remove-focus-on-editable-jtable-cell

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