Win a copy of Pragmatic AI this week in the Artificial Intelligence 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Operations on data in a JTable  RSS feed

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
 
Michael Cleary
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!