Sub SetTreeCellsBackgroundColor2(tv As TreeView, threshold As Int)
Dim joTV As JavaObject = tv
Dim joTCL As JavaObject = joTV.RunMethodJo("lookupAll", Array(".tree-cell"))
Dim joAL As JavaObject
joAL.InitializeNewInstance("java.util.ArrayList", Array(joTCL))
Dim l As List = joAL
For i = 0 To l.size - 1
Dim joIP As JavaObject = l.Get(i)
Dim ti As TreeItem = joIP.RunMethod("getTreeItem", Null)
If ti.IsInitialized And IsNumber(ti.Text) Then
If ti.Text < threshold Then
CSSUtils.SetBackgroundColor(l.Get(i), fx.Colors.green)
Else
CSSUtils.SetBackgroundColor(l.Get(i), fx.Colors.red)
End If
End If
Next
End Sub