<strong>JTable, selection and highlighting:</strong><br>addRowSelectionInterval(...) doesn't highlight the row in a JTable?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gert_Christiansen
Posted On:   Thursday, January 10, 2002 03:23 AM

Hi.

When i select some rows in a JTable using addRowSelectionInterval(...), the rows gets selected in the model, but they are not highlighted in the JTable.
I've tried to play with the repaint and focus stuff, but no luck.



Any help would be appreciated.



Regards,

Gert Christiansen

Re: <strong>JTable, selection and highlighting:</strong><br>addRowSelectionInterval(...) doesn't highlight the row in a JTable?

Posted By:   Gert_Christiansen  
Posted On:   Sunday, January 13, 2002 03:16 PM

I finally found the answer.



Regretfully it was completely my own fault, since i set the tablemodel after highlighting some rows. Duh!



Thanks to anybody who bothered to read my, as it turned out, *quite* unnecessary question, and i do apologize for any inconvenience.



Regards,

Gert Christiansen

Re: <strong>JTable, selection and highlighting:</strong><br>addRowSelectionInterval(...) doesn't highlight the row in a JTable?

Posted By:   Christopher_Schultz  
Posted On:   Thursday, January 10, 2002 05:17 AM

I think you'll have to call SelectionModel.fireSelectionChangedEvent, which should notify the JTable that the row selection has changed. Then, the JTable should update itself.



-chris
About | Sitemap | Contact