简体   繁体   English

JavaFX TabPane 标题 OverrunStyle

[英]JavaFX TabPane title OverrunStyle

I have a TabPane like below,我有一个如下所示的TabPane

在此处输入图像描述

I want the text to be clipped at close button, similar to how browsers display the title like below.我希望在关闭按钮处剪切文本,类似于浏览器显示标题的方式,如下所示。

在此处输入图像描述

I have tried css , -fx-text-overrun: clip;我试过css , -fx-text-overrun: clip; in .tab-pane and .tab class but not working as expected..tab-pane.tab class 但未按预期工作。

How can i achieve this?我怎样才能做到这一点?

I am able to achieve the required L&F by setting the Label preferred width.我可以通过设置Label首选宽度来实现所需的 L&F。

在此处输入图像描述

.tab-label {
    -fx-pref-width : 150px;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM