javafx Scene Builder TableView test data

Posted by sub3
2017.01.09 19:49 개발/JavaFX

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



완벽한 내용은 아닙니다만 스크롤은 생성되는 정도까지 나타납니다.


tableView 구조 파악에 도움 되시길.


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


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

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

<?import javafx.scene.control.cell.PropertyValueFactory?>

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

<?import javafx.scene.control.cell.*?> 

<?import javafx.collections.*?> 

<?import fxmltableview.*?> 

<?import java.lang.String?>


<BorderPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.65">

    <center>

        <TableView fx:id="table">

            <columns>

<TableColumn text="First Name">

<cellValueFactory><PropertyValueFactory property="firstName" />

</cellValueFactory>

</TableColumn>

<TableColumn text="Last Name">

<cellValueFactory><PropertyValueFactory property="lastName" />

</cellValueFactory>

</TableColumn>

<TableColumn text="Email Address">

<cellValueFactory><PropertyValueFactory property="email" />

</cellValueFactory>

</TableColumn>

</columns> 

<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>

        </TableView>

    </center>

</BorderPane>



저작자 표시
신고
이 댓글을 비밀 댓글로