본문 바로가기

개발/JavaFX

javafx Scene Builder listView test data

javafx의 listview 구현시 이것저것 확인해 보기 위한 listView.fxml 입니다.






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


<?import java.lang.String?>

<?import javafx.collections.FXCollections?>

<?import javafx.scene.control.ListView?>

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


<AnchorPane prefHeight="300.0" prefWidth="500.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainController">

   <children>

      <ListView fx:id="listView" layoutX="181.0" layoutY="14.0" prefHeight="274.0" prefWidth="307.0">

          <items>

            <FXCollections fx:factory="observableArrayList">

                <String fx:value="Item 1" />

                <String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

<String fx:value="Item 2" />

                <String fx:value="Item 3" />

                <String fx:value="Item 4" />

            </FXCollections>        

          </items>

      </ListView>

   </children>

</AnchorPane>