Skip to main content

JXTable highlighter update

Please note these forums are being decommissioned and use the new and improved forums at
2 replies [Last post]
Joined: 2013-11-06

I'm seeing a strange behaviour in regards to highlighter update in jxtable.
If I create the table, set some highlighters and start adding rows, I can see the highlighter is called on every row I add - which is to be expected.
But if I change the highlighters (i.e. set another one via setHighlighters method) on an already populated table, the highlighter is called only on rows which are visible in the pane.
Only if I scroll to some other rows, the highlighter is called on them as they become visible.
Is this behaviour expected? Is there any way to force the highlighter to run on all rows?

Reason I'm asking is because I am doing something else which depends on the results of the highlighter run.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-11

the Highlighter should be called *only* while painting, so I'm slightly surprised about the called-when-adding :-) The general rule is to not change any state while painting, so _doing something else which depends on the results of the higlighter_ is the wrong approach.

We might help to find a solution to your _real_ problem (aka: the goal you are after) if you tell us what it is - best with a SSCCE to demonstrate.


Joined: 2013-11-06

I am trying to create a highlighted scroll bar (kind of like what you have in netbeans/eclipse).
I want to see all colored rows on the scroll bar so that I can quickly see if there are "problems" at a certain location in the document.
Thing is, I don't want to scan the whole document twice (once for the highlighter and one for the scroll bar). I was thinking of using the scan results already performed by the highlighter.
I guess that's not an option...