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.
do you guys know if it is possible to put an entire row of a JTable into edit mode? I'm using a TableCellEditor to show a ComboBox/CheckBox/JButton in edit mode instead of the cell and this only works for the single cell that is edited
Manuel Etz wrote:What about a combination of a TableCellEditor and a TableCellRenderer? Don't you think this might work better?
This will also work. Probably make life simpler too.
Manuel Etz wrote:Why do you think it could get ugly? The Components should only be visible in the row that is being edited
I think it can get ugly because you need to cater the edit/rendering/(maybe even validation) for each cell. Now if these cells are of different components (combo box, text field, check box, etc) you need to do a bunch of checking for each type then make it editable. IF validation is also done, document listener or other listeners are used. This will make the class really big even maybe have some inner classes ... even bigger.
Honestly I have not give it much thought yet.
Joined: Feb 22, 2013
It works better than expected. My only problem is, that the cell i want to edit is displayed as an empty cell without a cursor ...
The renderer seems to work and the cell editor works too if you take away the repaint call in the prepareEditor method
Why doesn't it work in combination? I don't get it ...