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.
hi , i have implemented a class extending abstract table model and that class is displaying tha data from the resultset through a table . how can i edit the table cell , so that new value takes place of old value in the cell can u help me in this? thanks abki
Hi, In the class that you extend from AbstractTableModel, you must override two methods: isCellEditable must return true for all cells which you want should be editable. If you want that all cells should be editable just do:
This will allow users to edit values in the table. Now, to capture what value the user has passed, you have to override the setValueAt method. This method will be called when the user has finished editing a cell. The new value is passed as the first parameter. With this new value, you must do whatever it takes to make sure that a subsequent call to getValueAt on the same cell returns the new value (if the new value is acceptable). I am sure you will be able to find examples of what you are trying to do somewhere in this forum. Hope this helps, Abhik. [ July 04, 2003: Message edited by: Abhik Sarkar ]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com