Text 如何减少垂直文本/标签的数量

Text 如何减少垂直文本/标签的数量,text,javafx,rotation,width,Text,Javafx,Rotation,Width,我想在HBox的左侧放置一个垂直(旋转90度)标签。网格窗格应填充整个剩余空间。如果我减少旋转标签的宽度以减少其所需的水平空间,则文本长度将收缩。否则,如果我手动降低高度,什么也不会发生 如何减少旋转标签的使用频率 使用Scenebuilder和Windows 7。旋转标签,并将其包装在组中。将变换应用于标签后,将计算组的布局边界: import javafx.application.Application; import javafx.scene.Group; import javafx.sc

我想在HBox的左侧放置一个垂直(旋转90度)标签。网格窗格应填充整个剩余空间。如果我减少旋转标签的宽度以减少其所需的水平空间,则文本长度将收缩。否则,如果我手动降低高度,什么也不会发生

如何减少旋转标签的使用频率


使用Scenebuilder和Windows 7。

旋转
标签
,并将其包装在
组中
。将变换应用于标签后,将计算组的布局边界:

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

public class RotatedLabelTest extends Application {

    @Override
    public void start(Stage primaryStage) {
        Label hello = new Label("Hello");
        Label world = new Label("World");
        hello.setRotate(90);
        world.setRotate(90);
        HBox root = new HBox(5, new Group(hello), new Group(world));

        primaryStage.setScene(new Scene(root));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

旋转
标签
并将其包装成
。将变换应用于标签后,将计算组的布局边界:

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

public class RotatedLabelTest extends Application {

    @Override
    public void start(Stage primaryStage) {
        Label hello = new Label("Hello");
        Label world = new Label("World");
        hello.setRotate(90);
        world.setRotate(90);
        HBox root = new HBox(5, new Group(hello), new Group(world));

        primaryStage.setScene(new Scene(root));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}