• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why can't I do selection if I use my own cell renderer for JTable?  RSS feed

 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whatever I set the two:
setColumnSelectionAllowed(boolean)
setRowSelectionAllowed(boolean)
I cannot see the selected region like when I use the default cell renderer, I think I can select, just because my own cell renderer has its own foreground and background color, so the selected color cannot be seen - how to solve it?

thanks in advance

Yours Sincerely
Olnex
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps your rendered should allow the selected background color to be maintained when the cell is selected.
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks man, sorry for my late reply. I finally realised that my own CellRenderer doesn't work for the selection case, but I'm still confused how to cover that case.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to guess what unseen code is doing. Perhaps if you posted a minimal example program demonstrating your problem, forum members could suggest something.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!