This content has been marked as final. Show 3 replies
You can't clone any Node because they are not cloneable. Being able to do that would probably also be very error prone due to various restrictions on nodes. You will have to create them in code but one by one. Just write a little helper function to do that.
You might also define a template node in FXML via SceneBuilder and load that several times but I am not sure whether this makes sense because you would still have to adjust ids and such things.
Thanks for your input.
having the cloneable capability is important to me, and I believe there are ways to clone a node, afterall it is just another "complicated" object.
the choice to clone and work out as a class extension is what I am after and I have not explore using template node in FXML.
I personally have preference is java programming side rather than programming on FXML side.
Just thought to ask the community if there is an "easy" or a clever way to clone a node.
Earlier FX version has duplicate function but not available anymore...
Have you tried the Builders? I think one can call the build method several times but I have never tried that myself.