and interface to display I was also able to display this So now how can my Item automatically resize when the window changes
CodePudding user response:
Using setMinSize
setPrefSize
and setMaxSize
are the best options to manually and dynamically change the size of elements. Some objects do not have size options, so the width and height have to be set independently. Others do not have setPref
callouts either, so it is more difficult to manage.
setMinSize
sets the minimum size of an object. It cannot be made smaller, through user input or other means. It will automatically resize to the minimum size.
setPrefSize
sets the preferred size of an object. The object will always try to fit this size, but can become smaller or larger depending on other factors.
setMaxSize
sets the maximum size of an object. It cannot be made larger, through input or other means. It will automatically resize to the maximum size.
CodePudding user response:
Disclaimer: I couldn't see the images
If you are talking about layouts, JavaFX have a good amount of them examples are BorderPane
, VBox
, HBox
, GridPane
, and some more. (You should be able to easily Google these)
If you are talking about some arbitrary resizing and I couldn't provide the answer for that.