1

I wwrote the following code to Highlight a row in JXTreeTable ,

  public void treeExpanded(TreeExpansionEvent te) {
        final HighlightPredicate myPredicate = new HighlightPredicate() {

            @Override
            public boolean isHighlighted(Component renderer,
                    ComponentAdapter adapter) {
                double val = Double.valueOf(String.valueOf(adapter.getValueAt(1, 17)));
                return testCondition(val);
            }

            public boolean testCondition(double val) {
                if (val > 10) {
                    System.out.println("Met");

                    return true;
                } else {
                    System.out.println("NMet");

                    return false;
                }

            }
        };
        ColorHighlighter highlighter = new ColorHighlighter(myPredicate,
                Color.RED, // background color
                null);       // no change in foreground color

        table.addHighlighter(highlighter);
    }

it's not working . Pls Help

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
c.pramod
  • 606
  • 1
  • 8
  • 22
  • there is/are a some Bug(s) have to check all posts tagged as JXTreeTable / JTreeTable and search there for comments, answrers by @kleopatra – mKorbel Mar 14 '13 at 19:07
  • what do you mean by _not working_? @mKorbel not aware of any bugs (apart from some limitations due to the hack of using a tree component as renderer for the hierarchical column) – kleopatra Mar 16 '13 at 10:58

0 Answers0