Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Operations on data in a JTable  RSS feed

 
Michael Cleary
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
 
Craig Wood
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!