문제

정보 - 더 나은 서식을 위해 전체 게시물 전체에서 코드 포맷을 사용했습니다.

Hi,

I have a highlighted JXTable. Rows are highlighted, depending on the value 
of a specific column (c2). Everytime the value of column c2 changes, the color 
is switched from white to grey or from grey to white.

Example    
    c0  c1    c2   c3
    1 | aaa | ab | dd
    2 | aaa | ab | ee
    3 | aaa | cd | ff
    4 | aaa | cd | gg
    5 | bbb | ef | dd

Colors are like this:
1,2 -> white
3,4 -> grey
5   -> white

If I now filter for 'dd', my table looks like this

    c0  c1    c2   c3
    1 | aaa | ab | dd
    5 | bbb | ef | dd

And the colors are like this:
1 -> white
5 -> white

But I want the table to change the color of row 5, because the previous 
value in c2 was different.
See my Problem? How can I apply the highlighter again, on my JXTAble, 
after filtering? Or in other words, how can I highlight only the filtered 
values?
도움이 되었습니까?

해결책

두 번째 형광펜을 추가 할 수 있습니까?

jxTable.getHighlighters().addHighlighter()

jxtable이 효과적으로 필터링 될 때만 적용되는 것.

그것이 불가능하다면, 일단 행이 강조되면 다른 형광펜을 호출하지 않을 수 있으므로 컨트롤러를 정의하십시오 어느:

a) 테이블에 속성 Changelistner가 있으며 필터링 상태를 듣습니다.

b) 행 세트와 형광펜에 특별한 술어가 있습니다.

c) PropertyChange에서 행을 점검하려면 절대와 사용자 정의 사이의 형광펜의 술어를 적절하게 전환하십시오. 형광펜의 재산 변경은 리 페인트를 유발합니다

리 페인트 강제는 기본적으로 test.org.jdesktop.swingx.renderer 패키지의 HighLighterClientVisualCheck 샘플은 무엇입니까?

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