如何使用javafx创建响应式文本? [英] How can i create responsive text with javafx?
本文介绍了如何使用javafx创建响应式文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个标签,其中显示了一个数字,我现在想让这个数字响应GUI。
我该怎么做?这是我当前字体大小的数字。
I created a label with a number shown in it and I now want to make this number responsive to the GUI. How can I do that? Here is my number with its current font-size.
Label label = new Label();
label.setText("12");
label.setFont(Font.font("Comic Sans MS", 35));
感谢您的帮助:)
推荐答案
Anchorpane,HBOX等在性质上都很敏感。将标签放在HBOX内。
Anchorpane,HBOX etc. are responsive in nature.Put the label inside a HBOX.
希望这有帮助。
这篇关于如何使用javafx创建响应式文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文