Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

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: 3214
30
  • 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: 3214
30
  • 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?
 
What? What, what, what? What what tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic