java - Comparator for a specific column in JTable -
how can set custom comparator specific column in jtable?
the third column of table contains string representaion of double values , want creat comparator column when click on header of column sort according comparator.
the first question why, if managing doubles, dealing strings. should better if used doubles , set format in cellrenderer column.
anyway, looking may this: http://download.oracle.com/javase/tutorial/uiswing/examples/components/tablesorterdemoproject/src/components/tablesorter.java
edit: if somehow translation double representation complicated, create comparable class contains both double number , string representation. equals(), hashcode() , compareto() implemented using value of double; cellrenderer() , tostring() use string representation.
Comments
Post a Comment