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

  • Home
  • SEARCH
  • 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 8884093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:58:52+00:00 2026-06-14T20:58:52+00:00

The JXTable from the SwingX project has a method to set a RowFilter directly

  • 0

The JXTable from the SwingX project has a method to set a RowFilter directly on the JXTable (see JXTable#setRowFilter).

It is unclear to me what you need to do when the filter implementation is dynamic.

To compare: in the JDK they introduced the RowSorter interface in JDK1.6, and this interface allows to attach a RowSorterListener. If you have a dynamic RowSorter (which can also be used for filtering), you can fire an event to those listeners when the filter changes (although this requires that the filter has access to the RowSorter as there is no such thing as a DynamicRowFilter or RowFilterEvent in the JDK).

What I would expect is that I can set an “observable” RowFilter on the JXTable and that I have to do nothing. But as that seems not to be possible with the current API, what is the next best thing ?

  • set the filter again each time it changes. Will this even have effect as it is the exact same instance as was previously set on the JXTable ?
  • abuse the table events and just fire an event that your table model has been changed, which will retrigger the sorting/filtering
  • do not use the setRowFilter method and create your own TableRowSorter and fall back on the JDK API.
  • 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-14T20:58:53+00:00Added an answer on June 14, 2026 at 8:58 pm

    The use-case we have is a filter (not a rowfilter) which can be changed to filter out elements of a model, and we have a RowFilter based on that dynamic filter to filter out those elements

    Repeating my comment: the RowFilter must be immutable. That was a concious design decision back when sorting/filtering was introduced into core. So the approach to implement “dynamic” filtering is to

    • make your custom filter (not a rowFilter) observable
    • implement a listener to that filter which creates a new RowFilter on changes
    • set the rowFilter to the xtable (in SwingX) or to the DefaultRowSorter (in core)

    Edit

    I don’t agree with that design, but couldn’t sway him

    should be: I didn’t agree – meanwhile, I’m not so sure as I had been 😉

    The advantage of this approach is that the RowFilter is really small coin to implement and highly re-usable – just a simple predicate, nothing else. That allows simple logic compounding (and/or) of filters. No burden to notify on part of the filter, no burden on part of the sorter (or compound filter) to listen and update itself. Then taking into account that the “dynamics” of the filter change often comes from user interaction and something has to listen to those user triggers anyway, it’s not a big deal to create a new rowFilter vs. updating an existing rowFilter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently updated the SwingX library in an application from version 1.0 to 1.6.2
i'm workin on programe and i need to get the selected radio buttom from
By default, when you try to copy from a JTable , the toString method
My question is how can I make the hyperlinks from a JXTable column (just
How can I target (in JXTable) a specific column values from different rows to
I'm trying to set up code so that the user can drag from a
I use a JTable to display a search result of articles from a database
I have created one jTable. I want to display the data into table from
When I add columns to JTable , By default, they're arranged from left to
I am facing problem of duplicate rows in the JXTable . If I sort

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.