I want to add a Hyperlink
to my JavaFX 2 application. This link is ment to be vertically at the very left or right side of my app, just like you see it with minimized and docked modules in many applications - for example IntelliJ IDEA.
It turns out that placing the node is hard even in SceneBuilder, as the container wether grows or changes the coordinates of the Hyperlink
when i want to rotate it.
So my question is: How can i place one or more nodes that are rotated by wether 90 or 270 degrees within a container (preferrably VBox
or AnchorPane
) that's fix-sized?
Place the rotated node in a Group - that way the layoutBounds of the Group will match the boundsInParent of the rotated Node
. This is likely what you want because it means that the visual bounds of node are now used for layout purposes. This works for layout managers which automatically relocate nodes (such as VBox
).
You probably want do this in code, not in SceneBuilder. You can add a node to a parent (VBox or whatever) and apply a rotate transformation to it. Remember, all UI elements in JavaFX are just nodes in a scenegraph which can be transformed anyway you want.
See also the javadoc of Node, the paragraph about Transformations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With