【发布时间】:2015-04-24 01:29:43
【问题描述】:
我的问题如下图所示。我只想将标签设置为左侧而不是右侧的“...”-ed,因为这是更重要的部分。从代码开始,我可以向您展示我是如何设置标签的(但这并不重要):
final Label directory = new Label();
directory.setText(selectedDirectory.getPath());
【问题讨论】:
我的问题如下图所示。我只想将标签设置为左侧而不是右侧的“...”-ed,因为这是更重要的部分。从代码开始,我可以向您展示我是如何设置标签的(但这并不重要):
final Label directory = new Label();
directory.setText(selectedDirectory.getPath());
【问题讨论】:
你可以的
directory.setStyle("-fx-text-overrun: leading-ellipsis;");
或者,在外部样式表中:
.label {
-fx-text-overrun: leading-ellipsis ;
}
【讨论】: