• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding JTable Sorting

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic