filmov
tv
JavaFX Scene Builder Tutorial 39 - TableView and TableColumn

Показать описание
JavaFX Scene Builder Tutorial 39 TableView and TableColumn
The Table View control will be used to display the list of issues.
1 - In the Controls section of the Library panel, select Table View. Drag and drop it above the Split Pane (Vertical Flow) element's divider line
2- From the Menu bar, choose Modify and then Fit to Parent.
3 - Click the Code section of the Inspector panel and select table from the fx:id field's drop-down list of available instance variables.
4 - Set the properties of the two columns in the table view.
In the Hierarchy panel, select the row for the first TableColumn component under the row for the TableView component. In the Code section of the Inspector panel, select colName from the fx:id field's drop-down list.
Click the tab for the Properties section and set the Text property to Name:.
Back in the Hierarchy panel, select the row for the second Table Column component. In the Code section of the Inspector panel, select colStatus from the fx:id field's drop-down list.
Click the tab for the Properties section again and set the Text property to Status.
5 - Add another column to the table.
Select the Table Column control from the Library panel. Drag and drop it inside the table view in the Content panel. The new column is added to the right of the Status tab.
In the Code section of the Inspector panel, select colSynopsis from the fx:id field's drop-down list of available instance variables.
Click the tab for the Properties section again and set the Text property to Synopsis
6 - From the Menu bar, choose View and then Show Sample Data. Notice that the list view and the table view elements in the Content panel are populated with sample data. Choose View and then Hide Sample Data from the Menu bar to turn off the display of the sample data.
The Table View control will be used to display the list of issues.
1 - In the Controls section of the Library panel, select Table View. Drag and drop it above the Split Pane (Vertical Flow) element's divider line
2- From the Menu bar, choose Modify and then Fit to Parent.
3 - Click the Code section of the Inspector panel and select table from the fx:id field's drop-down list of available instance variables.
4 - Set the properties of the two columns in the table view.
In the Hierarchy panel, select the row for the first TableColumn component under the row for the TableView component. In the Code section of the Inspector panel, select colName from the fx:id field's drop-down list.
Click the tab for the Properties section and set the Text property to Name:.
Back in the Hierarchy panel, select the row for the second Table Column component. In the Code section of the Inspector panel, select colStatus from the fx:id field's drop-down list.
Click the tab for the Properties section again and set the Text property to Status.
5 - Add another column to the table.
Select the Table Column control from the Library panel. Drag and drop it inside the table view in the Content panel. The new column is added to the right of the Status tab.
In the Code section of the Inspector panel, select colSynopsis from the fx:id field's drop-down list of available instance variables.
Click the tab for the Properties section again and set the Text property to Synopsis
6 - From the Menu bar, choose View and then Show Sample Data. Notice that the list view and the table view elements in the Content panel are populated with sample data. Choose View and then Hide Sample Data from the Menu bar to turn off the display of the sample data.
Комментарии