dehlen
dehlen

Reputation: 7389

JavaFX Layout behaviour on resize

First of all I'd like to show you some photos, so you can better understand my problem. Not resized window

Resized to fullscreen

fxml configuration

I want to show a small arrow above my PieChart. This arrow should point to the center of the PieChart. When I start my application it looks fine, but when I resize the window to fullscreen the arrow goes far to the right. My ImageView lies in a AnchorPane->BorderPane(TOP) and I set the Anchor Constraints for the right and the top side. The PieChart lies also in an AnchorPane -> BorderPane(Center). There I set all 4 Anchor Constraints. But also when set all Anchor Constraints for the ImageView the resizing does not work.

Anbody has an idea how I can solve this resizing problem ? Maybe I can bind the position of the imageView to the one from the PieChart ?

Upvotes: 0

Views: 314

Answers (1)

James_D
James_D

Reputation: 209339

Just create a VBox, set the alignment to CENTER, and place the arrow and the pie chart in the VBox.

Upvotes: 2

Related Questions