Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Jtable  .. cell editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jtable  .. cell editor" Watch "Jtable  .. cell editor" New topic
Author

Jtable .. cell editor

Sandeep DSouza
Greenhorn

Joined: Dec 18, 2003
Posts: 18
Hi,
I have a question about setting the default cell editior for each column.
I need to know if it is possible to set two different cell editors for the same column on two different rows.
in the sense I have two combo boxes (A and B) and for column 1 on row 1 ... i want to set the default cell editor as combobox A and for column1 on row 2 .. i need to set the default cell editor as comboBoxB.
Can somebody help me with this one ... I will really appreciate it.
Thanks,
sandsouza
saager mhatre
Ranch Hand

Joined: Dec 20, 2000
Posts: 61
That's easy!
The getTableCellEditorComponent(...) method in TableCellEditor passes in the row and column indices of the cell being edited, you just monitor for the right one and send in the required component!

[ January 31, 2004: Message edited by: saager mhatre ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jtable .. cell editor