Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sort table

843805Jan 5 2006 — edited Jan 7 2006
I'm using the following:

http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/TableSorter.java

located in this site: http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/

to sort my table.. however, i can't sort my numbers as they seem to be stored as string... i've been trying this the whole day and i can't figure out why..PLS HELP ME..

I used filereader in order to populate the table since i read in the data from there.

the table consists of 2 cols. 1 string 1 double field for each row.

part of my codes:
while ((word = br.readLine()) != null)
{            	  
StringTokenizer st = new StringTokenizer(word);
 i=0;
       while (st.hasMoreTokens()) { 
                   data[j] = st.nextToken();
i++;
}
j++;
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2006
Added on Jan 5 2006
16 comments
208 views