Вопрос

I am using a basic Stage and Scene which only contains a Circle. Now even if I use an AnchorPane as scene it doesn't resize the Circle and if I use FXML the checkbox for resizability in the circle's properties is disabled. Can anyone help as to how i can react to the resizing of the window/stage, in a way that the circle resizes?

Это было полезно?

Решение

A circle is a a Shape and is not resizeable by default. You can simply bind the width/height of the circle to the width / height of the Scene. Use the properties and property binding. Here is a description of the API: http://www.guigarage.com/2013/01/custom-ui-controls-with-javafx-part3/

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top