Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with filtering JTable (AbstractTableModel)

 
Liana Norpunova
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello! I have a problem with filtering JTable (AbstractTableModel)... So, this is my code:



When I type some char in the textfield, then the table is filtered incorrectly. For example, I can get the word "Fellow" after typing the char "g". I cannot understand why it happens. Pliz any suggestions?
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liana Norpunova wrote:Pliz any suggestions?

Please UseRealWords: "please".

I'm moving this to our GUI forum. In the mean time you could try re-setting the row sorter:
 
Liana Norpunova
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I've changed the code as you have proposed, however the problem remains...((

 
Liana Norpunova
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I've solved the problem. This is my code for multiple filters for JTable, maybe one day it will be useful for someone:



Thanks!
 
The moustache of a titan! The ad of a flea:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!