dcsimg
When and how to resize single row in JTable
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Graham_Weeks
Posted On:   Tuesday, January 8, 2002 08:33 AM

The subject is a bit simplistic - here is the problem. I wish to install a custom cell editor on a per cell basis. The editor requires more real estate than the renderer. I have tried to handle this by calling setRowHeight within getCellEditor . Unfortunately, after the editor is installed, but before it is displayed, the framework calls validate which cascades down to columnMarginChanged . The first thing that columnMarginChanged does is to check if the cell is being edited and if it is then the editor is removed! From this it appears that I need to adjust the height of the row before the editor is installed. But how? I've tried installing a handler for the MouseEvent but I see this a   More>>

The subject is a bit simplistic - here is the problem.


I wish to install a custom cell editor on a per cell basis. The editor requires more real estate than the renderer.


I have tried to handle this by calling setRowHeight within getCellEditor . Unfortunately, after the editor is installed, but before it is displayed, the framework calls validate which cascades down to columnMarginChanged . The first thing that columnMarginChanged does is to check if the cell is being edited and if it is then the editor is removed!


From this it appears that I need to adjust the height of the row before the editor is installed. But how? I've tried installing a handler for the MouseEvent but I see this after getCellEditor has been called.


The approach I haven't tried yet is to override columnMarginChanged but to me this does not seem the correct thing to do.


All suggestions welcome - I've been chasing this for a while now!

   <<Less

Re: When and how to resize single row in JTable

Posted By:   Jon_Benton  
Posted On:   Tuesday, January 8, 2002 02:34 PM

Instead of mucking about trying to jam your editor into the cell, why not pop up your editor over the cell, using the glass pane of the root container?


I once installed a popup menu as the editor for a column in a table, and that's essentially what it did, and it didn't seem out of place or kl├╝dgie.

Cheers,

Jon

About | Sitemap | Contact