Button style with image

后端 未结 2 1424
被撕碎了的回忆
被撕碎了的回忆 2021-01-26 15:19

I was wondering How one can achieve following button style where text resides underneath of image in JavaFx?

I tried a lot but all in vain. Any help would be appreciate

2条回答
  •  盖世英雄少女心
    2021-01-26 15:58

    The key is the contentDisplay property, set it to "TOP".

    With fxml:

    
    

    Or CSS:

    .your-selector {
        -fx-content-display: top;
    }
    

    Check the CSS reference here.

提交回复
热议问题