0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JAVAFX コンボボックス

Posted at

アンカーペインにコンボボックス入れた図

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="項目1" />
                <String fx:value="項目2" />
                <String fx:value="項目3" />
                <String fx:value="項目4" />
                <String fx:value="項目5" />
            </FXCollections>
        </items>
    </ComboBox>
</AnchorPane>

FXMLでコンボボックスの中身を書くことができる

combobox.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?