Private Sub SetCircleClip (pnl As B4XView,radius As Int)
#if B4J
Dim jo As JavaObject = pnl
Dim shape As JavaObject
Dim cx As Double = pnl.Width
Dim cy As Double = pnl.Height
shape.InitializeNewInstance("javafx.scene.shape.Rectangle", Array(cx, cy))
If radius > 0 Then
Dim d As Double = radius
shape.RunMethod("setArcHeight", Array(d))
shape.RunMethod("setArcWidth", Array(d))
End If
jo.RunMethod("setClip", Array(shape))
#else if B4A
Dim jo As JavaObject = pnl
jo.RunMethod("setClipToOutline", Array(True))
pnl.SetColorAndBorder(pnl.Color,0,0,radius)
#Else If B4I
Dim NaObj As NativeObject = pnl
Dim BorderWidth As Float = NaObj.GetField("layer").GetField("borderWidth").AsNumber '<------------------fLOAT'
' *** Get border color ***
Dim noMe As NativeObject = Me
Dim BorderUIColor As Int = noMe.UIColorToColor (noMe.RunMethod ("borderColor:", Array (pnl)))
pnl.SetColorAndBorder(pnl.Color,BorderWidth,BorderUIColor,radius)
#end if
End Sub