This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
When i edit the combo and then I press the TAB or ENTER key then all works fine and the value in the TableModel is updated with the edited one,
if i leave the cell with the mouse
traverse to another cell through arrow keys
click on any other cell, the typed value is going off
and the value is not passed to the TableModel. Why ? Is there a way to solve this problem ?
If you have an examples of editable Jcombobox in JTable working without hitting enter key... I searched in this site as well.. but not found useful links. please post that if you have any.
Example : Jcombobox has 3 choices. On selecting 3 rd choice, it should become editable and user should key the value. Now at this point, user move the tab or click on the mouse, the entered value should be selected in the jcombo box.
But jcombobox is taking the value only on click of enter key.
i have _exactly_ the same problem. i already wasted hours to find a solution, but no luck.
i would be glad for any help!
while implementing my own CellEditor i found out, that getCellEditorValue() is called before the editable combox has "updated" the string. so getSelectedItem() still returns the old value but shortly after that it would return the right value!
somehow there should be a method like "combobox.stopEditing()" or something...