Dim PJO As JavaObject = mBase
Dim StyleSheetName As String = "cmenu.css"
Do While Not(PJO Is AnchorPane)
PJO = PJO.RunMethod("getParent",Null)
Loop
Dim StyleSheets As JavaObject = PJO.RunMethod("getStylesheets",Null)
Dim Iterator As JavaObject = StyleSheets.RunMethod("iterator",Null)
Dim S As String
Dim Found As Boolean
Do While Iterator.RunMethod("hasNext",Null)
S = Iterator.RunMethod("next",Null)
If S.Contains(StyleSheetName) Then
Found = True
Exit
End If
Loop
If Not(Found) Then PJO.RunMethodJO("getStylesheets",Null).RunMethod("add",Array(File.GetUri(File.DirAssets,StyleSheetName)))
Log(PJO.RunMethod("getStylesheets",Null))