Button style with image

后端 未结 2 1422
被撕碎了的回忆
被撕碎了的回忆 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 16:14

    You can simply achieve that just by doing

        Button b = new Button("text", graphics);
        b.setContentDisplay(ContentDisplay.TOP);
    

    And for cool icons, take a look at http://fxexperience.com/controlsfx/features/ it include icone from FontAwesome and IcoMoon

提交回复
热议问题