JavaFX – how to make ComboBox hgrow?
•
Java
I have JavaFX (8), H@R_509_2419 @, Combo@R_509_2419 @And hgrow
This is my fxml Code:
<?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <V@R_509_2419@ prefHeight="117.0" prefWidth="285.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.test.TestController"> <children> <H@R_509_2419@ prefHeight="105.0" prefWidth="196.0" V@R_509_2419@.vgrow="ALWAYS"> <children> <Combo@R_509_2419@ fx:id="fxCboTest" prefHeight="25.0" prefWidth="62.0" H@R_509_2419@.hgrow="ALWAYS" /> </children> </H@R_509_2419@> </children> </V@R_509_2419@>
This code will lead to:
I have also tried the following code (without success, this code does nothing):
H@R_509_2419@.setHgrow(uiController.fxCboTest,Priority.ALWAYS);
Does anyone know how to make it Combo@R_509_2419 @ HGrow?
Solution
This is the answer to my own question
This will result in the following code / XML from scenebuilder:
... <children> <Combo@R_509_2419@ maxWidth="1.7976931348623157E308" prefWidth="150.0" H@R_509_2419@.hgrow="ALWAYS" /> </children> ...
Among them, 1.7976931348623157e308 looks like double MAX_ VALUE. This also applies to H@R_509_2419 @Multiple controls in
In my opinion, this is not very / continuous I still don't know why hgrow can't be used for Combo@R_509_2419 @.
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码