java - JTable content editing -
i'm trying edit selected column in selected row button click
contacttable.getmodel().setvalueat( contacttable.getvalueat(contacttable.getselectedrow(), contacttable.getselectedcolumn()), contacttable.getselectedrow(), contacttable.getselectedcolumn() ); but before saving button click if don't click in column edit doesn't work, reason? , how can fix it?
the edited value still in cell editor, not in tablemodel. value automatically saved if move cell in table.
however, if click on button must manually save data. can done in 1 of 2 ways:
- in actionlistener of button can manually invoke stopcellediting() method of editor
- add property table save edits when table loses focus.
check out table stop editing more information , examples of these 2 approaches.
Comments
Post a Comment