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 8746499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:12:13+00:00 2026-06-13T12:12:13+00:00

I have a JTable that am Filtering in relation to JTextField input. It is

  • 0

I have a JTable that am Filtering in relation to JTextField input. It is only Filtering Rows based on the first characters. For example if My Column 2 has Values:

VALUES PARAMETER
PARAMETER VALUES
.
.

When I type V into the JTextfield it will show the row with VALUES PARAMETER and leave the row with PARAMETER VALUES I need an advanced Filter such that when I type V it will be able to show me the Two rows or any other rows where there is a Name Starting with the Value typed in the JTextField: Here is My Filter….(Part)

 jtfSearch.getDocument().addDocumentListener(new DocumentListener() {
        public void changedUpdate(DocumentEvent e) {
            newFilter();
        }

        public void insertUpdate(DocumentEvent e) {
            newFilter();
        }

        public void removeUpdate(DocumentEvent e) {
            newFilter();
        }
    });

My Filter Method:

 public void newFilter() {
    RowFilter< MyTableModel, Object> rf = null;
    try {
        rf = RowFilter.regexFilter("^" + jtfSearch.getText(), 1);
    } catch (Exception as) {
        System.err.println(as);
        return;
    }
    sorter.setRowFilter(rf);
}

Is it an Issue of the Regex filter or what Should I do?

  • 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-13T12:12:14+00:00Added an answer on June 13, 2026 at 12:12 pm

    I assume that jtfSearch.getText() returns the text from the entire row, is this correct? If so, then presumably the issue is just that you have "^" at the start of your regex, take this out and it should match anywhere in the full row content.

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

Sidebar

Related Questions

I have a ScrollPane and JTable that should only have one row of data.
The problem I have is that when more rows are added to JTable (jtbls)
I have a jTable with two columns.First column is set as Boolean(for checkbox) and
I have a JTable in Java that has a custom dataMOdel and custom renderer.
I have a JTable that is using a TableColumnModelListener() to detect when the column
I have a JTable that I am displaying in a JScrollpane. The JTable only
I have a JTable that will have the last column data field change to
I have a column in JTable that binds to the underlying boolean property on
I have a jTable set so that it is read only, and selection is
I am trying to make a JTable that has column spans available. Specifically, I

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.