Hi I need to make the 2nd column in a JTable to accept different data types eg; Integer, Float, String, Color, File, Font(cell rendered as a textfield with a borderlayout & a button within the textfield's east layout with a dialog box popping up when the button is clicked). How can a single column of a JTable be taken care of all these requirements? Thanks Meghna
Hi, I dont think so it would be possible for a column to accept the said data types. The entire column can have only one datatype. I would be pleased to know if it is possible to do so. Regards Durga
Originally posted by Meghna ks: Hi I need to make the 2nd column in a JTable to accept different data types eg; Integer, Float, String, Color, File, Font(cell rendered as a textfield with a borderlayout & a button within the textfield's east layout with a dialog box popping up when the button is clicked). How can a single column of a JTable be taken care of all these requirements? Thanks Meghna
Hi Paul & Durga Thanks for the immediate response. Paul -> I did go thro' the link you mailed me, but could'nt come up with something that suits my requirement. But, this link offers an example, I'm trying to build on this example. Wish me luck !! http://www.javaworld.com/javaworld/javatips/jw-javatip102.html
Hi Meghna, Thanks for making me aware of the link. I had gone thru the link, the RowEditorModel basically sets the editor for the entire row, which is what we don't want. We want to set the editor at a cell level not yet row level. You may have to change this RowEditorModel to CellEditorModel. The CellEditorModel should return me a editor if I call getEditor(int row, int col). Please let me know how you could do it. Regards Durga
Originally posted by Meghna ks: Hi Paul & Durga Thanks for the immediate response. Paul -> I did go thro' the link you mailed me, but could'nt come up with something that suits my requirement. But, this link offers an example, I'm trying to build on this example. Wish me luck !! http://www.javaworld.com/javaworld/javatips/jw-javatip102.html
Beware the other head of science - it bites! Nibble on this message: