Skip to main content

JTable Sorting

1 reply [Last post]
Anonymous

Hello JDNC!

I am the author of Glazed Lists, a Java library that
provides table sorting and filtering, similar to JDNC.
http://publicobject.com/glazedlists/

For the Glazed Lists website I am creating a document
to compare the Java libraries that can be used to add
interactive sorting to a JTable.

Needless to say, JDNC lives up to its goal by making
this easy to do with little code.

I have 2 questions:

- Is it possible to use multiple Comparators for a single
column with JXTable? For example, for a column with 2
comparators: one that is case-sensitive and another that is not.
These would be selected by using a modifier ('CTRL' etc)
or by clicking several times on the table's header.

- Is it possible to sort using multiple columns simultaneously?
I read in your mailing list archive that this can be set up
programatically, but I want to know if this can be done interactively
simply by clicking on multiple column headers.

You can view the current document, complete with
screenshots on 3 different platforms here:
http://publicobject.com/glazedlists/sortedjtables/

Thanks for your time and a great toolkit!
-Jesse

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rameshgupta
Offline
Joined: 2004-06-04
Points: 0

>
> Hello JDNC!
>
> I am the author of Glazed Lists, a Java library that
> provides table sorting and filtering, similar to
> JDNC.
> http://publicobject.com/glazedlists/

I tried to access the above link, but it appears to be broken.

>
> For the Glazed Lists website I am creating a document
> to compare the Java libraries that can be used to add
> interactive sorting to a JTable.
>
> Needless to say, JDNC lives up to its goal by making
> this easy to do with little code.
>

Thank you! But we also understand we have a long way to go before we really live up to our goal ;-)

>
> I have 2 questions:
>
> - Is it possible to use multiple Comparators for a
> single column with JXTable? For example, for a column
> with 2 comparators: one that is case-sensitive and
> another that is not.
> These would be selected by using a modifier ('CTRL'
> etc) or by clicking several times on the table's header.
>

Not at the moment. Interesting idea though.

> - Is it possible to sort using multiple columns
> ns simultaneously?
> I read in your mailing list archive that this can be
> set up programatically, but I want to know if this can
> be done interactively simply by clicking on multiple
> column headers.
>

Yes, JDNC implements a stable sorting algorithm. Multi-column sort may be performed by sequentially clicking in column headers.

>
> You can view the current document, complete with
> screenshots on 3 different platforms here:
> http://publicobject.com/glazedlists/sortedjtables/
>

Sorry, the link is broken :-(

Ramesh