Javafx图像和文本在按钮上对齐 [英] Javafx Image and Text align on Button

查看:52
本文介绍了Javafx图像和文本在按钮上对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Javafx按钮,并添加了图像和文本.我想在Javafx按钮的顶部放置文本,在Javafx按钮的中间放置图像.javafx是否有可能,我该怎么做?

I created a javafx button and added image and text.I want text place to top and image place to middle of the javafx button.Is it possible with javafx and how can I do it?

推荐答案

您必须使用button.setContentDisplay(ContentDisplay.TOP);

ContentDisplay

这篇关于Javafx图像和文本在按钮上对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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