JXTable - تمييز بعد تصفية الجدول
-
10-07-2019 - |
سؤال
معلومات عن أفضل تنسيق, أنا استخدم رمز تنسيق طوال نشر.
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 بفعالية تصفيتها.
إذا كان هذا غير ممكن, لأن مرة واحدة في صف واحد وقد تم تسليط الضوء الأخرى أقلام قد لا يكون هناك ما يمكن أن تعريف وحدة تحكم وهو:
أ) propertyChangeListner إلى طاولة الاستماع الى تصفية الدولة
ب) الخاصة المسند مع مجموعة من الصفوف و تمييز
ج) على propertyChange التحقق من الصف تبديل تمييز ما بين المسند أبدا المخصصة الخاصة بك حسب الاقتضاء.حدود الملكية التغيير سوف تؤدي إلى إعادة رسم
فرض رسم أساسا ما لا HighlighterClientVisualCheck العينة في الاختبار.org.jdesktop.swingx.عرض الحزمة.
لا تنتمي إلى StackOverflow