• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jtable highlight cells (refresh issue)

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic