具有多个文本行的JavaFX Button [英] JavaFX Button with multiple text lines

查看:360
本文介绍了具有多个文本行的JavaFX Button的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在屏幕上创建一个工具栏,它有多个按钮,每个按钮必须有多行文本。例如:

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:

我查看了互联网和StackOverflow,但我找不到任何显示如何在JavaFX中执行此操作的内容。我正在使用JavaFX 8.

I looked over the internet and StackOverflow but I couldn't find anything showing how to do this in JavaFX. I'm using JavaFX 8.

有人可以帮助我吗?

Tks

推荐答案

我解决了这个问题,包括我的按钮内的VBox,然后在VBox中包含几个标签。像这样:

I resolved this problem including a VBox inside my button, and then including several Labels inside the VBox. Like this:

结果是:

如果有更优雅的方法可以得到相同的结果,请告诉我。
谢谢。

If there is a more elegant way to have the same result, please, let me know. Thank you.

这篇关于具有多个文本行的JavaFX Button的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆