Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8416887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:53:39+00:00 2026-06-10T01:53:39+00:00

I already have this: TableRowSorter<FileTableModel> rs = new TableRowSorter<FileTableModel>(ftm); rs.setComparator(COL_NAME, new Comparator<DisplayFile>() { //<sorting

  • 0

I already have this:

TableRowSorter<FileTableModel> rs = new TableRowSorter<FileTableModel>(ftm);
    rs.setComparator(COL_NAME, new Comparator<DisplayFile>() {
            //<sorting code>
        }
    });
    setRowSorter(rs);

and it works. It sorts the rows as it should when the user clicks on the header.
I just can’t figure out an easy way to sort the rows without the click on the header.
I want rows to already be sorted when they are displayed (user can then change asc/desc/etc. by clicking on column headers.)

How can i force the sorting? I know I could sort the rows in my TableModel, but i already have a working comparator, why not use it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:53:40+00:00Added an answer on June 10, 2026 at 1:53 am
    rowSorter.toggleSortOrder(colIndex);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already have this code to force these URLs to HTTPS: RewriteCond %{HTTPS}
This is my php code (I already have a connection to the db): $result
I have this code private void saveImage() { Bitmap bmp1 = new Bitmap(pictureBox.Image); bmp1.Save(c:\\t.jpg,
I already have this code but it gives me the wrong result. private void
I already have this piece of functioning code, but after writing it I did
I already have this code: <?php if ($quantity == 0){ $prd_name = ; $colors
I already have this code from another question on this website. Help.ShowHelp(ParentForm, (C:\Users\Beaudean\Desktop\Help.chm),HelpNavigator.TableOfContents, Nothing)
I'm working on my mobile site, I already have this code: <script type=text/javascript> //
I already have this issue but I cannot remember how to solved it. (I
I'm sure others have already asked this, but is it possible to insert an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.