Yubaraj
Yubaraj

Reputation: 3988

How to make filterable to jtable record using netbeans ide

There are many rows on above showing jtable. I want to filter record by short code. If I type short code like 1234 it should be display only short code 1234 associated row on jtable.

Thanks

Upvotes: 0

Views: 1859

Answers (1)

MadProgrammer
MadProgrammer

Reputation: 347184

You're going to have write the code...Start by checking out how to use tables, in particular sorting and filtering

The basic requirement would be to attach an ActionListener to both the field and button (you can do this from the form editor if you wish).

Within the actionPerformed event handler method, you need to create a RowFilter and apply it to the tables RowSorter.

A table can be configured to automatically create a row sorter by setting the autoCreateRowSorter property to true.

It's all explained nicely in the linked tutorials...

And another example

Upvotes: 4

Related Questions