如何在 FXML 中的 Tab 控件中添加图标? [英] How to add an icon to the Tab control in FXML?
本文介绍了如何在 FXML 中的 Tab 控件中添加图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 javafx 2.0.我想在 fxml 的 Tab 中添加一个图标:
I'm using javafx 2.0. I want to add an icon to the Tab in fxml:
示例:
<TabPane>
<tabs>
<Tab text="abc" >
</Tab>
</tabs>
</TabPane>
推荐答案
我找到了解决方案:
<Tab>
<graphic>
<ImageView>
<image>
<Image url="@image.png"/>
</image>
</ImageView>
</graphic>
<content>
...
</content>
</Tab>
这篇关于如何在 FXML 中的 Tab 控件中添加图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文