954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Time count

Hi, does anyone know how to calculate the time difference between one row and another row inside one column?

The time is already sort in a column. So, I hope to know that the difference time between first row and second row and consequently.
Time is count by using the milliseconds. After count, can it convert back to string and display in the JTable?

If anyone can help, really appreciate it.

rainny
Light Poster
29 posts since Dec 2007
Reputation Points: 6
Solved Threads: 1
 

So you have times stored in milliseconds in a JTable? Then use the getValueAt(row, column) method of JTable to get the values from the cells that are next to each other. If you look at the JTable documentation for the getValueAt method, you'll notice that the return type is Object. So if you have Integers stored in each cell, then when you call getValueAt, cast the Objects it returns to Integers, then subtract them. JTable Documentation

BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You