我想将窗格调整为旋转的子窗格。
代码:
public class Test extends Application {
public void start(final Stage stage) throws Exception {
Pane p1 = new Pane();
p1.setBackground(new Background(new BackgroundFill(Color.CYAN, null, null)));
p1.setPrefSize(100, 100);
p1.setMinSize(100, 100);
p1.setMaxSize(100, 100);
p1.setRotate(45);
Pane p2 = new Pane(p1);
p2.setBackground(new Background(new BackgroundFill(Color.RED, null, null)));
p2.setLayoutX(150);
p2.setLayoutY(150);
Group root = new Group(p2);
Scene scene = new Scene(root);
stage.setTitle("Pane Test");
stage.setScene(scene);
stage.setWidth(400);
stage.setHeight(400);
stage.setResizable(false);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
我想让父窗格完全覆盖被孩子遮挡的区域。