JDK 8 TreeView disclosure triangle vertical aligned not correctly

Viewed 779

I make a custom tree cell which has height 40 px.

And here a problem disclosure triangle does not aligned center vertically.

enter image description here

Here code of tree cell:

public static class TestObjectCell extends AnchorPane implements ISMPBVisualComponentWithData<TestObject>{

        public Label label;

        public TestObjectCell(){
            label=new Label("label");
            AnchorPane.setTopAnchor(label, 10.0);
            this.getChildren().setAll(label);
            this.setMinHeight(40);
            this.setPrefHeight(40);
            this.setMaxHeight(40);
        }


        @Override
        public void setComponentData(TestObject object) {
            //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }



    }

As u can see at picture disclosure triangle aligned at top, how do align him vertical center of cell?

3 Answers
Related