Sorting for a JTable


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Sorting for a JTable

Hybrid View

  1. #1
    Ramkumar Guest

    Sorting for a JTable


    Hi,
    Are there any code samples available which implements mulitple column sorting
    on a JTable?That is, values based on the first column are sorted, then second
    column is sorted without disturbing the sorting of the first.

    eg:

    1 11 12
    2 22 22
    1 12 11
    2 21 23
    1 10 11

    will should be sorted into
    1 10 11
    1 11 12
    1 12 11
    2 21 23
    2 22 22
    if sorting is required on the first two columns

    TIA,
    Ramkumar





  2. #2
    tejkumar Guest

    Re: Sorting for a JTable


    Mr.ramkumar,
    you have to sort the table on second coloumn and then group by the first
    colomn then u will get the desired
    output.
    "Ramkumar" <ramkuma@usa.net> wrote:
    >
    >Hi,
    >Are there any code samples available which implements mulitple column sorting
    >on a JTable?That is, values based on the first column are sorted, then second
    >column is sorted without disturbing the sorting of the first.
    >
    >eg:
    >
    >1 11 12
    >2 22 22
    >1 12 11
    >2 21 23
    >1 10 11
    >
    >will should be sorted into
    >1 10 11
    >1 11 12
    >1 12 11
    >2 21 23
    >2 22 22
    >if sorting is required on the first two columns
    >
    >TIA,
    >Ramkumar
    >
    >
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center