Answer the question
In order to leave comments, you need to log in
How to find the height of a container in JavaFX?
How to find the height of the container anchorPane 2 if only ComboBox was passed to the method? In the picture, I described my actions, but at the end I come to a dead end ... Maybe there is some other way to find out its height?
Answer the question
In order to leave comments, you need to log in
In javafx, all nodes have a generic setUserData(object) and getUserData() method. Here is the easiest way to do something like combobox.setUserData(anchorPane2.getHeight() ) and then directly in the method itself where only the combobox is passed to get it getUserData().
Another option is to move along your path, as I understand it, mainParrent is the root of the window, so to speak, then you get the nodes in it, pull out the scrollPane from there, get the nodes from the scrollPane and take the anchorPane2 in it, get the desired property from the anchorPane2.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question