旋转Label并将其包裹在一个Group.在将转换应用于标签后,将计算组的布局边界:
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);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
786 次 |
| 最近记录: |