문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top