NO IMAGE

要說這fxml語法有點奇特,在控制元件中加入右鍵選單的程式碼如下

        <TreeView fx:id=”foldertree” GridPane.rowIndex=”2″ GridPane.columnIndex=”0″  GridPane.hgrow=”ALWAYS” GridPane.vgrow=”ALWAYS”>
            <contextMenu>
                <ContextMenu >
                    <items><MenuItem text=”ss” /></items>
                </ContextMenu>
            </contextMenu>
        </TreeView>

必須要巢狀兩個contextmenu 一個首字母小寫一個首字母大寫,真是奇怪。