欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

JavaFX 逐级弹出的图元组件

程序员文章站 2022-03-30 22:05:05
...

 JavaFX 逐级弹出的图元组件

import com.jfoenix.controls.JFXNodesList;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

public class Test extends Application {
    private JFXNodesList jfxNodesList = new JFXNodesList();
    private Pane pane = new Pane();

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

    @Override
    public void start(Stage primaryStage) {
        // 文本内容长度不等,显示的间隔会受影响,可用空格补充至相等
        JFXNodesList jfxNodesList1 = new JFXNodesList();
        jfxNodesList1.setRotate(180);
        jfxNodesList1.addAnimatedNode(new Label("点击我"));
        jfxNodesList1.addAnimatedNode(new Label("A"));
        jfxNodesList1.addAnimatedNode(new Label("B"));
        JFXNodesList jfxNodesList2 = new JFXNodesList();
        jfxNodesList2.setRotate(180);
        jfxNodesList2.addAnimatedNode(new Label("点击我"));
        jfxNodesList2.addAnimatedNode(new Label("C"));
        jfxNodesList2.addAnimatedNode(new Label("D"));
        JFXNodesList jfxNodesList3 = new JFXNodesList();
        jfxNodesList3.setRotate(180);
        jfxNodesList3.addAnimatedNode(new Label("点击我"));
        jfxNodesList3.addAnimatedNode(new Label("E"));
        jfxNodesList3.addAnimatedNode(new Label("F"));
        jfxNodesList.setTranslateY(100);
        jfxNodesList.addAnimatedNode(new Label("点击我"));
        jfxNodesList.addAnimatedNode(jfxNodesList1);
        jfxNodesList.addAnimatedNode(jfxNodesList2);
        jfxNodesList.addAnimatedNode(jfxNodesList3);
        jfxNodesList.setSpacing(50);
        jfxNodesList.setRotate(270);
        pane.getChildren().add(jfxNodesList);
        primaryStage.setScene(new Scene(pane, 400, 400));
        primaryStage.show();
    }
}

 

相关标签: # JavaFX