Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jtable highlight cells (refresh issue)

 
Preston Taylor
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a part of my jtable class that colors certain cells based on their value (see code below) My problem is that when the order of the rows (or columns) are changed the highlite is not refreshed and doesn't fallow it's respective cell



 
Rob Camick
Ranch Hand
Posts: 2616
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you start sorting or reordering columns you need to understand how model and view work:



There is a similiar method for the column conversion as well.

 
Preston Taylor
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a little reading and looking up of some API. I read through the very little that http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting this page has to offer and as far as I can understand my highlighting is going by the view row rather than the model row?

so is all I need to do is change a few lines in my highlighting code to convert the coordinates or am I over simplifying?
 
Preston Taylor
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bumpity!

//looked trough the FAQs and tried to find some rules, couldn't...
//hope bumping isn't forbidden.
 
Rob Camick
Ranch Hand
Posts: 2616
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the bump for, you have your answer already?

What happened when you tried the code? If you had a problem, then where is the SSCCE showing the problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic