aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Editing a Table Cell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Editing a Table Cell" Watch "Editing a Table Cell" New topic
Author

Editing a Table Cell

guenter krannich
Greenhorn

Joined: Sep 15, 2003
Posts: 24
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

Joined: Aug 17, 2006
Posts: 81
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

Joined: Sep 15, 2003
Posts: 24
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

Joined: Feb 07, 2006
Posts: 45
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
 
subject: Editing a Table Cell