dcsimg
JTable : where's the RowModel?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bruno_D
Posted On:   Tuesday, May 20, 2003 08:03 AM

I'm making some kind of 'properties panel', a panel that contains a bunch of key : values pairs. It contains only two columns, the left one for the keys and the right one for the values. I had to fuss around a little with things because in my case the CellEditors are different depending on the rows, so for example one property will have a true/false combo, another some text field, etc. So my quesion is why isnt there any getRowModel (and hence no RowModel class) that would allow me to change the default cell editors for each row? How can I do this then without it getting all ugly? Also, I noticed that class JTable has a function called getCellEditor(row,col), but no setCellEditor(editor,row,col) (it only has setCellEditor with the new editor lik   More>>

I'm making some kind of 'properties panel', a panel that contains a bunch of key : values pairs. It contains only two columns, the left one for the keys and the right one for the values.



I had to fuss around a little with things because in my case the CellEditors are different depending on the rows, so for example one property will have a true/false combo, another some text field, etc.



So my quesion is why isnt there any getRowModel (and hence no RowModel class) that would allow me to change the default cell editors for each row? How can I do this then without it getting all ugly? Also, I noticed that class JTable has a function called getCellEditor(row,col), but no setCellEditor(editor,row,col) (it only has setCellEditor with the new editor like setCellEditor(editor)). What does that mean, how can one work with that weird setCellEditor function? :)



Thanks alot!

   <<Less

Re: JTable : where's the RowModel?

Posted By:   Bruno_D  
Posted On:   Tuesday, May 20, 2003 08:06 AM

Actually I thought about this : in my case its much like I'm using the table by flipping the columns and rows... My column for keys is exactly like the tableHeader, and my second column is for the values (the table itself)... So is there a convenient way to tell swing to flip the rows / column in order to display the table header on first column and the values in second column?



Thanks again :)

About | Sitemap | Contact