This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I am trying to create a treetable that displays numerical data. I want the user to be able to edit the data in the treetable by clicking on a cell and entering a new value. I figured out how to create the treetable and treetable model, but I can't figure out how to do the event handling. I read somewhere that I need to extend DefaultCellEditor, but I haven't been able to figure out how to do that.
I have studied the three-part Sun treetable tutorial:
The bookmarks example (bookmarks.zip) in the third article runs okay and allows user–editing of the URLs in the "Location" column. I compiled it in j2se 1.5 with these changes: 1 — changed the deprecated show method to setVisible at the end of the TreeTableExample3 constructor 2 — in the getValueAt method of the DynamicTreeTableModel class: j2se 1.5+ has the "varargs" feature so change the "null" values to zero–length arrays in the reflection methods:
This second change should not be necessary in older versions.