aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Regarding JTable Sorting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Regarding JTable Sorting" Watch "Regarding JTable Sorting" New topic
Author

Regarding JTable Sorting

Milesh Dcunha
Greenhorn

Joined: Jun 19, 2006
Posts: 13
Hi All,

I cannot use JDK 1.6.
I needed the Table sorting and filtering functionality in JTable in JDK 1.5.
So what I did was got the following files from JDK1.6 and made up my own library. The following is the list of the files:

DefaultRowSorter.java
JTable.java
RowFilter.java
RowSorter.java
SortOrder.java

RowSorterEvent.java
RowSorterListener.java

TableRowSorter.java
TableStringConverter.java

I wrote my own renderers and created a custom table model by extending the AbstractTableModel.

The sorting and filtering is working fine.

Now I am developing some program in JDK1.5 and using the library created by me for the sorting of JTable. I have extended the DefaultTableModel of JDK1.5. Sorting is working fine.

I face issues when I do drag and drop. The table rows are getting properly exported to the destination table, but when I delete the rows from the source table improper rows are getting deleted.

I convert the rows that are being dragged to the proper index using the convertRowIndexToModel method of the JDK1.6 JTable. But even then I am getting the same results...

Any inputs as to why this is happening? Do I need to add some more java files from the JDK1.6 library.
[ February 21, 2007: Message edited by: Milesh Dcunha ]

The world is becoming an orgy of self-sacrifice when it is precisely the self that should not be sacrificed.
 
jQuery in Action, 2nd edition
 
subject: Regarding JTable Sorting