JAVAFX-Kombinationsfeld

Abbildung mit einem Kombinationsfeld im Ankerfenster

sample.fxml



<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.layout.AnchorPane?>

<?import javafx.collections.FXCollections?>
<?import java.lang.String?>
<AnchorPane maxHeight="-Infinity"
            maxWidth="-Infinity"
            minHeight="-Infinity"
            minWidth="-Infinity"
            prefHeight="400.0"
            prefWidth="600.0"
            xmlns:fx="http://javafx.com/fxml/1">
    <ComboBox layoutX="36.0" layoutY="50.0" prefWidth="150.0" >
        <items>
            <FXCollections fx:factory="observableArrayList">
                <String fx:value="Gegenstand 1" />
                <String fx:value="Punkt 2" />
                <String fx:value="Punkt 3" />
                <String fx:value="Punkt 4" />
                <String fx:value="Punkt 5" />
            </FXCollections>
        </items>
    </ComboBox>
</AnchorPane>

Sie können den Inhalt des Kombinationsfelds mit FXML schreiben

combobox.png

Recommended Posts

JAVAFX-Kombinationsfeld
JavaFX-Text
JavaFx-Memorandum