I am using JIDE within a Matlab uitable. Thereby I got columns with elements of double type. These elements corespond to temperature values from -300 to +250. I now want to sort them to easily check which is the highest/lowest. Therefore I am using following code to enable sorting. My Problem is, that instead of sorting numbers this way (e.g. 145 129 90 2 -1) , the data gets sorted like this (-1 129 145 2 90). It´s obvious that the program is just sorting after the first numeric value. Has someone got a clue about how to sort these numbers right? I suppose I will have to Change the way the program compares/sorts These elements. Perhaps there is something to do with its comparators?!
- Code: Select all
% Display the uitable and get its underlying Java object handle
jscrollpane = findjobj(hTable);
jtable = jscrollpane.getViewport.getView;
% Now turn the JIDE sorting on
jtable.setSortable(true);
jtable.setAutoResort(true);
jtable.setMultiColumnSortable(true);
jtable.setPreserveSelectionsAfterSorting(true);
Many thanks in advance!