JavaFX Button with multiple text lines

前端 未结 6 2081
一个人的身影
一个人的身影 2021-01-13 04:35

I need to create a toolbar in my screen that will have multiple buttons, and each button must have multiple lines of Text. For example:

6条回答
  •  北荒
    北荒 (楼主)
    2021-01-13 05:27

    Label label= new Label("your long text here");
    label.setStyle("-fx-max-width : 180px);
    label.setWrapText(true);
    

提交回复
热议问题