Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

horizontal scroll in JTable losing rendered cell color

 
sathi rv
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using a JTable implementing MVC pattern, using AbstractTableModel. Each Rows data is rendered with different Color based on the content, using DefaultTableCellRenderer .
Now, the issue is, Upon horizontal scrolling in the JTable, the Rows data is losing its rendered Color.
Any help on this would be highly appreciated.
 
sathi rv
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No replies ??? Strange ... nobody encountered this issue ?
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, not had that problem and I have had different colours in a status showing table. If you post your code we could try out the program and see if it works the same way for us.
 
inam reyi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have tried working on this , on scrolling the indivisual row color remains . i am using the DefaultTableCellRenderer, but u need to setCellRenderer with the instantiated cellrenderer.
 
sathi rv
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I figured out my mistake. problem was with the way i implemented the coloring logic inside getTableCellRendererComponent method of DefaultTableCellRenderer class.
Thanks.
 
Skool. Stay in. Smartness. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!