• 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

Operations on data in a JTable

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I generate a JTable from data which is contained in a plain text file on a remote server. I use the "JTable(Vector rowData, Vector columnNames)" constructor to create the table. What I need to do is the following:

- For each column in the table, I need to find the maximum, minimum, and average value, and then highlight the max and min values by using a different font color. I will also display these values in a separate summary table which is positioned below the main table.

- Is it possible to have row "headers" as well as column headers? (this would be only for the small summary table)


In order to go through the columns one by one, what I have thought about doing is to:

getColumncount()

for each column,
getColumn(Object identifier)

but since I don't know the identifer, I'd need to use TableColumn.getIdentifier()

This is as far as I've gotten. Am I even headed in the right direction? Or is there some other obviously better way that I have missed entirely?

Thanks,
Mike
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Michael Cleary
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow! Thanks! Excellent - this will help me out a lot! The end of the quarter is looming closer and closer, and I'm running out of runway...
I haven't really done much Swing before, and now that's all I'm doing!

Thanks again,
Mike
 
reply
    Bookmark Topic Watch Topic
  • New Topic