B4J Question How is the Visual Designer Shadow property applied to a node??

Cableguy

Expert
Licensed User
Longtime User
Hi guys...

Hope someone can cast a light on this one...
I've been trying to completely copy the style from one node to another...
The Original node is created in the Visual Designer, and in there I set the Shadow property to my liking... The target node is created within the code...
But, listing the original node style, there's no reference to the shadow effect (-fx-effect:)...

So, simply cloning the styles (node2.style = node1.style) does not give the target node the exact same appearance as the original one, which makes me think that the shadow is being applied with some other mechanism than css, or javafx classes...

PLEASE CAN SOMEONE TURN A LIGHT ON THIS??
 

Cableguy

Expert
Licensed User
Longtime User
ok, nice, so that means that with javaobject we should be able to retrieve it...

(I need to get a grasp of that javaobject thing)
 
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I'm sorry to re-open this but, I want to be able to change the Color properties of an already set Shadow effect (in the designer).
I know I need to use the same approach, by using JavaObject and the setMethod, but I cant figure out the parameters to pass

[EDIT]
I managed to find how:

B4X:
    Dim src As JavaObject = node1
    Dim Color As Paint = fx.Colors.red
    Dim scrr As JavaObject=src.runMethod("getEffect",Null)
    scrr.RunMethod("setColor",Array (Color))
 
Last edited:
Upvote 0
Top