String « JTable « Java Swing Q&A





2. comparing a string value with a jtable value    coderanch.com

What's not working? Is nothing selected? Or only a single row? If the latter is the case, you might want to avoid using setRowSelectionInterval - that will result in only that row being selected. Instead, you'll want to call clearSelection before the loops, then addRowSelectionInterval in the loop. Another approach is use a table cell renderer for this: class HighlightRenderer extends ...