This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Editing a Table Cell

 
guenter krannich
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to edit a cell of a table, so I have this:

Everything's fine, but how can I tell (Whom?) sth like editingStopped?
Now I have to select another row to get rid of the Textfield.
Looking forward to your help!
 
Brian Mozhdehi
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You stated - "Everything's fine, but how can I tell (Whom?) sth like editingStopped?
Now I have to select another row to get rid of the Textfield."

OK, I looked at this a few times and I am confused by what your question is, i.e. I dont understand it as it is phrased. What are trying to do and what is happening?
 
guenter krannich
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry:
within the setValue method an internal frame is opened and the basis for the TableModel is manipulated. After the user closes that frame, the textfield is still there, the new cell content is hidden, the row deselected. Only after the selection of another row, the textfield disappears and the new cell content is visible.
So my guess is, "someone" didn't get the fact, that the table cell editing is finished and I probably have to explicitly call a "editingStopped" method, or send end equivalent event, or ...
Can you see my problem now?
 
prashant gour
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TableCellEditor tce = mTable.getCellEditor();
if (tce != null)
{
// Stops the editing
tce.stopCellEditing();
// Clears the selected cell
mTable.getSelectionModel().clearSelection();
}
you can stop editing with above code. call this in desired event.
it might help you.

~Prashant
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic