File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Regarding JTable Sorting" Watch "Regarding JTable Sorting" New topic

Regarding JTable Sorting

Milesh Dcunha

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:

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.
I agree. Here's the link:
subject: Regarding JTable Sorting
It's not a secret anymore!